| 47 | }; |
| 48 | |
| 49 | std::shared_ptr<CBlock> Block(const uint256& prev_hash) |
| 50 | { |
| 51 | static int i = 0; |
| 52 | static uint64_t time = Params().GenesisBlock().nTime; |
| 53 | |
| 54 | CScript pubKey; |
| 55 | pubKey << i++ << OP_TRUE; |
| 56 | |
| 57 | auto ptemplate = BlockAssembler(Params()).CreateNewBlock(pubKey, false); |
| 58 | auto pblock = std::make_shared<CBlock>(ptemplate->block); |
| 59 | pblock->hashPrevBlock = prev_hash; |
| 60 | pblock->nTime = ++time; |
| 61 | |
| 62 | CMutableTransaction txCoinbase(*pblock->vtx[0]); |
| 63 | txCoinbase.vout.resize(1); |
| 64 | txCoinbase.vin[0].scriptWitness.SetNull(); |
| 65 | pblock->vtx[0] = MakeTransactionRef(std::move(txCoinbase)); |
| 66 | |
| 67 | return pblock; |
| 68 | } |
| 69 | |
| 70 | std::shared_ptr<CBlock> FinalizeBlock(std::shared_ptr<CBlock> pblock) |
| 71 | { |
no test coverage detected