Skip to content

Commit df53a3e

Browse files
ryanofskySjors
andcommitted
rpc refactor: stop using deprecated getCoinbaseCommitment method
There should be no change in behavior Co-authored-by: Sjors Provoost <sjors@sprovoost.nl>
1 parent 0b4cd08 commit df53a3e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/rpc/mining.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,8 +1015,9 @@ static RPCHelpMan getblocktemplate()
10151015
result.pushKV("signet_challenge", HexStr(consensusParams.signet_challenge));
10161016
}
10171017

1018-
if (!block_template->getCoinbaseCommitment().empty()) {
1019-
result.pushKV("default_witness_commitment", HexStr(block_template->getCoinbaseCommitment()));
1018+
if (auto coinbase{block_template->getCoinbaseTx()}; coinbase.required_outputs.size() > 0) {
1019+
CHECK_NONFATAL(coinbase.required_outputs.size() == 1); // Only one output is currently expected
1020+
result.pushKV("default_witness_commitment", HexStr(coinbase.required_outputs[0].scriptPubKey));
10201021
}
10211022

10221023
return result;

0 commit comments

Comments
 (0)