mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-04 06:12:07 +01:00
Add util::Expected (std::expected)
This commit is contained in:
@@ -536,8 +536,8 @@ static RPCHelpMan getblockfrompeer()
|
||||
throw JSONRPCError(RPC_MISC_ERROR, "Block already downloaded");
|
||||
}
|
||||
|
||||
if (const auto err{peerman.FetchBlock(peer_id, *index)}) {
|
||||
throw JSONRPCError(RPC_MISC_ERROR, err.value());
|
||||
if (const auto res{peerman.FetchBlock(peer_id, *index)}; !res) {
|
||||
throw JSONRPCError(RPC_MISC_ERROR, res.error());
|
||||
}
|
||||
return UniValue::VOBJ;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user