Add util::Expected (std::expected)

This commit is contained in:
MarcoFalke
2025-12-04 15:54:19 +01:00
parent e68517208b
commit fa114be27b
9 changed files with 181 additions and 14 deletions

View File

@@ -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;
},