| 3642 | } |
| 3643 | |
| 3644 | void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams) |
| 3645 | { |
| 3646 | int commitpos = GetWitnessCommitmentIndex(block); |
| 3647 | static const std::vector<unsigned char> nonce(32, 0x00); |
| 3648 | if (commitpos != NO_WITNESS_COMMITMENT && DeploymentActiveAfter(pindexPrev, consensusParams, Consensus::DEPLOYMENT_SEGWIT) && !block.vtx[0]->HasWitness()) { |
| 3649 | CMutableTransaction tx(*block.vtx[0]); |
| 3650 | tx.witness.vtxinwit.resize(1); |
| 3651 | tx.witness.vtxinwit[0].scriptWitness.stack.resize(1); |
| 3652 | tx.witness.vtxinwit[0].scriptWitness.stack[0] = nonce; |
| 3653 | block.vtx[0] = MakeTransactionRef(std::move(tx)); |
| 3654 | } |
| 3655 | } |
| 3656 | |
| 3657 | std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams) |
| 3658 | { |
no test coverage detected