refactor: use CHECK_NONFATAL to avoid single-use symbol

This commit is contained in:
Sjors Provoost 2024-06-28 10:35:13 +02:00
parent 8426e018bf
commit 323cfed595
No known key found for this signature in database
GPG Key ID: 57FF9BDBCC301009

View File

@ -778,9 +778,7 @@ static RPCHelpMan getblocktemplate()
} }
ENTER_CRITICAL_SECTION(cs_main); ENTER_CRITICAL_SECTION(cs_main);
std::optional<uint256> maybe_tip{miner.getTipHash()}; tip = CHECK_NONFATAL(miner.getTipHash()).value();
CHECK_NONFATAL(maybe_tip);
tip = maybe_tip.value();
if (!IsRPCRunning()) if (!IsRPCRunning())
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Shutting down"); throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Shutting down");