Skip to content

Commit

Permalink
Fixed bug in opencl calculation and in devfund address checking
Browse files Browse the repository at this point in the history
  • Loading branch information
tmrlvi committed Dec 31, 2021
1 parent 60e8078 commit 5c3b9a0
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 18 deletions.
80 changes: 79 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions resources/kaspa-opencl.cl
Original file line number Diff line number Diff line change
Expand Up @@ -224,22 +224,22 @@ kernel void heavy_hash(
uchar16 hash_part[4];
for (int i=0; i<4; i++) {
hash_part[i] = (uchar16)(
(hash_[2*i] & 0xF0) >> 4,
(hash_[2*i] & 0x0F),
(hash_[2*i+1] & 0xF0) >> 4,
(hash_[2*i+1] & 0x0F),
(hash_[2*i+2] & 0xF0) >> 4,
(hash_[2*i+2] & 0x0F),
(hash_[2*i+3] & 0xF0) >> 4,
(hash_[2*i+3] & 0x0F),
(hash_[2*i+4] & 0xF0) >> 4,
(hash_[2*i+4] & 0x0F),
(hash_[2*i+5] & 0xF0) >> 4,
(hash_[2*i+5] & 0x0F),
(hash_[2*i+6] & 0xF0) >> 4,
(hash_[2*i+6] & 0x0F),
(hash_[2*i+7] & 0xF0) >> 4,
(hash_[2*i+7] & 0x0F)
(hash_[8*i] & 0xF0) >> 4,
(hash_[8*i] & 0x0F),
(hash_[8*i+1] & 0xF0) >> 4,
(hash_[8*i+1] & 0x0F),
(hash_[8*i+2] & 0xF0) >> 4,
(hash_[8*i+2] & 0x0F),
(hash_[8*i+3] & 0xF0) >> 4,
(hash_[8*i+3] & 0x0F),
(hash_[8*i+4] & 0xF0) >> 4,
(hash_[8*i+4] & 0x0F),
(hash_[8*i+5] & 0xF0) >> 4,
(hash_[8*i+5] & 0x0F),
(hash_[8*i+6] & 0xF0) >> 4,
(hash_[8*i+6] & 0x0F),
(hash_[8*i+7] & 0xF0) >> 4,
(hash_[8*i+7] & 0x0F)
);
}

Expand Down
10 changes: 10 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ impl Opt {
}
log::info!("kaspad address: {}", self.kaspad_address);

let miner_network = self.mining_address.split(":").next();
let devfund_network = self.devfund_address.split(":").next();
if miner_network.is_some() && devfund_network.is_some() && miner_network != devfund_network {
self.devfund_percent = 0;
log::info!(
"Mining address ({}) and devfund ({}) are not from the same network. Disabling devfund.",
miner_network.unwrap(), devfund_network.unwrap()
)
}

if self.no_gpu {
self.cuda_device = None;
self.opencl_device = None;
Expand Down
1 change: 0 additions & 1 deletion src/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ impl MinerManager {
} else {
let hash = state_ref.calculate_pow(nonces[0]);
warn!("Something is wrong in GPU code! Got nonce {}, with hash real {} (target: {})", nonces[0], hash.0[3], state_ref.target.0[3]);
break;
}
}

Expand Down

0 comments on commit 5c3b9a0

Please sign in to comment.