@@ -3094,25 +3094,23 @@ std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBloc
3094
3094
std::vector<unsigned char > commitment;
3095
3095
int commitpos = GetWitnessCommitmentIndex (block);
3096
3096
std::vector<unsigned char > ret (32 , 0x00 );
3097
- if (DeploymentEnabled (consensusParams, Consensus::DEPLOYMENT_SEGWIT)) {
3098
- if (commitpos == NO_WITNESS_COMMITMENT) {
3099
- uint256 witnessroot = BlockWitnessMerkleRoot (block, nullptr );
3100
- CHash256 ().Write (witnessroot).Write (ret).Finalize (witnessroot);
3101
- CTxOut out;
3102
- out.nValue = 0 ;
3103
- out.scriptPubKey .resize (MINIMUM_WITNESS_COMMITMENT);
3104
- out.scriptPubKey [0 ] = OP_RETURN;
3105
- out.scriptPubKey [1 ] = 0x24 ;
3106
- out.scriptPubKey [2 ] = 0xaa ;
3107
- out.scriptPubKey [3 ] = 0x21 ;
3108
- out.scriptPubKey [4 ] = 0xa9 ;
3109
- out.scriptPubKey [5 ] = 0xed ;
3110
- memcpy (&out.scriptPubKey [6 ], witnessroot.begin (), 32 );
3111
- commitment = std::vector<unsigned char >(out.scriptPubKey .begin (), out.scriptPubKey .end ());
3112
- CMutableTransaction tx (*block.vtx [0 ]);
3113
- tx.vout .push_back (out);
3114
- block.vtx [0 ] = MakeTransactionRef (std::move (tx));
3115
- }
3097
+ if (commitpos == NO_WITNESS_COMMITMENT) {
3098
+ uint256 witnessroot = BlockWitnessMerkleRoot (block, nullptr );
3099
+ CHash256 ().Write (witnessroot).Write (ret).Finalize (witnessroot);
3100
+ CTxOut out;
3101
+ out.nValue = 0 ;
3102
+ out.scriptPubKey .resize (MINIMUM_WITNESS_COMMITMENT);
3103
+ out.scriptPubKey [0 ] = OP_RETURN;
3104
+ out.scriptPubKey [1 ] = 0x24 ;
3105
+ out.scriptPubKey [2 ] = 0xaa ;
3106
+ out.scriptPubKey [3 ] = 0x21 ;
3107
+ out.scriptPubKey [4 ] = 0xa9 ;
3108
+ out.scriptPubKey [5 ] = 0xed ;
3109
+ memcpy (&out.scriptPubKey [6 ], witnessroot.begin (), 32 );
3110
+ commitment = std::vector<unsigned char >(out.scriptPubKey .begin (), out.scriptPubKey .end ());
3111
+ CMutableTransaction tx (*block.vtx [0 ]);
3112
+ tx.vout .push_back (out);
3113
+ block.vtx [0 ] = MakeTransactionRef (std::move (tx));
3116
3114
}
3117
3115
UpdateUncommittedBlockStructures (block, pindexPrev, consensusParams);
3118
3116
return commitment;
0 commit comments