Skip to content

Commit

Permalink
[Stratum] Prioritise blocks found by built-in stratum miner.
Browse files Browse the repository at this point in the history
  • Loading branch information
maaku committed May 13, 2021
1 parent f4d57f3 commit b0f2fa3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/stratum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,19 @@ bool SubmitBlock(StratumClient& client, const uint256& job_id, const StratumWork
block.nNonce = nNonce;
std::shared_ptr<const CBlock> pblock = std::make_shared<const CBlock>(block);
res = ProcessNewBlock(Params(), pblock, true, NULL);
if (res) {
LOCK(cs_main);
if (!mapBlockIndex.count(hash)) {
LogPrintf("Unable to find new block index entry; cannot prioritise block 0x%s\n", hash.ToString());
} else {
CBlockIndex* block_index = mapBlockIndex.at(hash);
CValidationState state;
PreciousBlock(state, Params(), block_index);
if (!state.IsValid()) {
LogPrintf("Database error while prioritising new block 0x%s: %d (%s) %s\n", hash.ToString(), state.GetRejectCode(), state.GetRejectReason(), state.GetDebugMessage());
}
}
}
} else {
LogPrintf("NEW SHARE!!! by %s: %s\n", client.m_addr.ToString(), hash.ToString());
}
Expand Down

0 comments on commit b0f2fa3

Please sign in to comment.