| 3993 | } |
| 3994 | |
| 3995 | void ChainstateManager::UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev) const |
| 3996 | { |
| 3997 | int commitpos = GetWitnessCommitmentIndex(block); |
| 3998 | static const std::vector<unsigned char> nonce(32, 0x00); |
| 3999 | if (commitpos != NO_WITNESS_COMMITMENT && DeploymentActiveAfter(pindexPrev, *this, Consensus::DEPLOYMENT_SEGWIT) && !block.vtx[0]->HasWitness()) { |
| 4000 | CMutableTransaction tx(*block.vtx[0]); |
| 4001 | tx.vin[0].scriptWitness.stack.resize(1); |
| 4002 | tx.vin[0].scriptWitness.stack[0] = nonce; |
| 4003 | block.vtx[0] = MakeTransactionRef(std::move(tx)); |
| 4004 | } |
| 4005 | } |
| 4006 | |
| 4007 | void ChainstateManager::GenerateCoinbaseCommitment(CBlock& block, const CBlockIndex* pindexPrev) const |
| 4008 | { |
no test coverage detected