refactor: use CHECK_NONFATAL to avoid single-use symbol

This commit is contained in:
Sjors Provoost 2024-06-26 12:29:33 +02:00
parent 5fb2b70489
commit f6dc6db44d
No known key found for this signature in database
GPG Key ID: 57FF9BDBCC301009

View File

@ -667,9 +667,7 @@ static RPCHelpMan getblocktemplate()
ChainstateManager& chainman = EnsureChainman(node);
Mining& miner = EnsureMining(node);
LOCK(cs_main);
std::optional<uint256> maybe_tip{miner.getTipHash()};
CHECK_NONFATAL(maybe_tip);
uint256 tip{maybe_tip.value()};
uint256 tip{CHECK_NONFATAL(miner.getTipHash()).value()};
std::string strMode = "template";
UniValue lpval = NullUniValue;