Merge ef19a193fc into merged_master (Bitcoin PR bitcoin/bitcoin#30356)

This commit is contained in:
ivanlele 2026-03-09 14:55:47 +00:00
commit 9cfa8d130d
No known key found for this signature in database
6 changed files with 42 additions and 19 deletions

View file

@ -392,7 +392,7 @@ static RPCHelpMan generateblock()
ChainstateManager& chainman = EnsureChainman(node);
{
std::unique_ptr<CBlockTemplate> blocktemplate{miner.createNewBlock(coinbase_script, /*use_mempool=*/false)};
std::unique_ptr<CBlockTemplate> blocktemplate{miner.createNewBlock(coinbase_script, {.use_mempool = false})};
if (!blocktemplate) {
throw JSONRPCError(RPC_INTERNAL_ERROR, "Couldn't create new block");
}
@ -801,9 +801,7 @@ static RPCHelpMan getblocktemplate()
}
ENTER_CRITICAL_SECTION(cs_main);
std::optional<uint256> maybe_tip{miner.getTipHash()};
CHECK_NONFATAL(maybe_tip);
tip = maybe_tip.value();
tip = CHECK_NONFATAL(miner.getTipHash()).value();
if (!IsRPCRunning())
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Shutting down");