From df53a3e5ec8781833c29682ff9e459fca489fa7b Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Wed, 11 Feb 2026 21:34:08 -0500 Subject: [PATCH] rpc refactor: stop using deprecated getCoinbaseCommitment method There should be no change in behavior Co-authored-by: Sjors Provoost --- src/rpc/mining.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index ee80b903248..e21d0d137c0 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -1015,8 +1015,9 @@ static RPCHelpMan getblocktemplate() result.pushKV("signet_challenge", HexStr(consensusParams.signet_challenge)); } - if (!block_template->getCoinbaseCommitment().empty()) { - result.pushKV("default_witness_commitment", HexStr(block_template->getCoinbaseCommitment())); + if (auto coinbase{block_template->getCoinbaseTx()}; coinbase.required_outputs.size() > 0) { + CHECK_NONFATAL(coinbase.required_outputs.size() == 1); // Only one output is currently expected + result.pushKV("default_witness_commitment", HexStr(coinbase.required_outputs[0].scriptPubKey)); } return result;