Skip to content

Commit

Permalink
rpc: default_witness_commitment is not optional
Browse files Browse the repository at this point in the history
As of a806647  the commitment is never empty.
  • Loading branch information
Sjors committed Aug 21, 2023
1 parent 36f62c5 commit 8e1d13f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ static RPCHelpMan getblocktemplate()
{RPCResult::Type::STR, "bits", "compressed target of next block"},
{RPCResult::Type::NUM, "height", "The height of the next block"},
{RPCResult::Type::STR_HEX, "signet_challenge", /*optional=*/true, "Only on signet"},
{RPCResult::Type::STR_HEX, "default_witness_commitment", /*optional=*/true, "a valid witness commitment for the unmodified block template"},
{RPCResult::Type::STR_HEX, "default_witness_commitment", "a valid witness commitment for the unmodified block template"},
}},
},
RPCExamples{
Expand Down Expand Up @@ -948,9 +948,7 @@ static RPCHelpMan getblocktemplate()
result.pushKV("signet_challenge", HexStr(consensusParams.signet_challenge));
}

if (!pblocktemplate->vchCoinbaseCommitment.empty()) {
result.pushKV("default_witness_commitment", HexStr(pblocktemplate->vchCoinbaseCommitment));
}
result.pushKV("default_witness_commitment", HexStr(pblocktemplate->vchCoinbaseCommitment));

return result;
},
Expand Down

0 comments on commit 8e1d13f

Please sign in to comment.