| 68 | } |
| 69 | |
| 70 | std::shared_ptr<CBlock> FinalizeBlock(std::shared_ptr<CBlock> pblock) |
| 71 | { |
| 72 | pblock->hashMerkleRoot = BlockMerkleRoot(*pblock); |
| 73 | |
| 74 | while (!CheckProofOfWork(pblock->GetHash(), pblock->nBits, false, Params().GetConsensus())) { |
| 75 | pblock->nNonce = ArithToUint256(UintToArith256(pblock->nNonce) + 1); |
| 76 | } |
| 77 | |
| 78 | return pblock; |
| 79 | } |
| 80 | |
| 81 | // construct a valid block |
| 82 | const std::shared_ptr<const CBlock> GoodBlock(const uint256& prev_hash) |
no test coverage detected