Skip to content

Commit eb459d2

Browse files
authored
Merge pull request duality-solutions#267 from EhssanD/v2.4-WIP
Fixed miner issues
2 parents 651f71f + 8508778 commit eb459d2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/miner/impl/miner-gpu.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ int64_t GPUMiner::TryMineBlock(CBlock& block)
2727
const auto _end = END(block.nNonce);
2828
const void* input = (_begin == _end ? pblank : static_cast<const void*>(&_begin[0]));
2929
const std::uint64_t device_target = ArithToUint256(_hash_target).GetUint64(3);
30+
std::uint32_t start_nonce = block.nNonce;
3031

31-
std::uint32_t result_nonce = _processing_unit.scanNonces(input, block.nNonce, device_target);
32+
//Increase nNonce for the next batch
33+
block.nNonce += _batch_size_target;
34+
35+
std::uint32_t result_nonce = _processing_unit.scanNonces(input, start_nonce, device_target);
3236

3337
if ( result_nonce < std::numeric_limits<uint32_t>::max()){
3438
block.nNonce = result_nonce;

src/miner/miner-util.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ void SetBlockPubkeyScript(CBlock& block, const CScript& scriptPubKeyIn)
379379
CMutableTransaction txCoinbase(*block.vtx[0]);
380380
// Set coinbase out address
381381
txCoinbase.vout[0].scriptPubKey = scriptPubKeyIn;
382+
//It should be added to the block
383+
block.vtx[0] = MakeTransactionRef(std::move(txCoinbase));
382384
// Generate merkle root hash
383385
block.hashMerkleRoot = BlockMerkleRoot(block);
384386
}

0 commit comments

Comments
 (0)