Always add default_witness_commitment with GBT client support
Github-Pull: #9189 Rebased-From: ad04d1cb35b9612d36078c62213bdbb13f56d73d
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
da5a16b11d
commit
99477c71c4
@@ -3503,15 +3503,8 @@ std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBloc
|
||||
{
|
||||
std::vector<unsigned char> commitment;
|
||||
int commitpos = GetWitnessCommitmentIndex(block);
|
||||
bool fHaveWitness = false;
|
||||
for (size_t t = 1; t < block.vtx.size(); t++) {
|
||||
if (!block.vtx[t].wit.IsNull()) {
|
||||
fHaveWitness = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
std::vector<unsigned char> ret(32, 0x00);
|
||||
if (fHaveWitness && IsWitnessEnabled(pindexPrev, consensusParams)) {
|
||||
if (consensusParams.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout != 0) {
|
||||
if (commitpos == -1) {
|
||||
uint256 witnessroot = BlockWitnessMerkleRoot(block, NULL);
|
||||
CHash256().Write(witnessroot.begin(), 32).Write(&ret[0], 32).Finalize(witnessroot.begin());
|
||||
|
||||
Reference in New Issue
Block a user