| 57 | } |
| 58 | |
| 59 | void RegenerateCommitments(CBlock& block, ChainstateManager& chainman) |
| 60 | { |
| 61 | CMutableTransaction tx{*block.vtx.at(0)}; |
| 62 | tx.vout.erase(tx.vout.begin() + GetWitnessCommitmentIndex(block)); |
| 63 | tx.witness.vtxoutwit.erase(tx.witness.vtxoutwit.begin() + GetWitnessCommitmentIndex(block)); |
| 64 | block.vtx.at(0) = MakeTransactionRef(tx); |
| 65 | |
| 66 | CBlockIndex* prev_block = WITH_LOCK(::cs_main, return chainman.m_blockman.LookupBlockIndex(block.hashPrevBlock)); |
| 67 | GenerateCoinbaseCommitment(block, prev_block, Params().GetConsensus()); |
| 68 | |
| 69 | block.hashMerkleRoot = BlockMerkleRoot(block); |
| 70 | } |
| 71 | |
| 72 | BlockAssembler::Options::Options() |
| 73 | { |