| 60 | } |
| 61 | |
| 62 | CTxIn MineBlock(const NodeContext& node, const CScript& coinbase_scriptPubKey) |
| 63 | { |
| 64 | auto block = PrepareBlock(node, coinbase_scriptPubKey); |
| 65 | |
| 66 | while (!CheckProofOfWork(block->GetHash(), block->nBits, Params().GetConsensus())) { |
| 67 | ++block->nNonce; |
| 68 | assert(block->nNonce); |
| 69 | } |
| 70 | |
| 71 | bool processed{Assert(node.chainman)->ProcessNewBlock(Params(), block, true, nullptr)}; |
| 72 | assert(processed); |
| 73 | |
| 74 | return CTxIn{block->vtx[0]->GetHash(), 0}; |
| 75 | } |
| 76 | |
| 77 | std::shared_ptr<CBlock> PrepareBlock(const NodeContext& node, const CScript& coinbase_scriptPubKey) |
| 78 | { |
no test coverage detected