fix after merging updated ::wire:: code

This commit is contained in:
Lee *!* Clagett 2023-06-17 20:43:20 -04:00
parent 606f632d93
commit 1b7e8b9902
2 changed files with 9 additions and 2 deletions

View file

@ -93,7 +93,11 @@ namespace rpc
expect<full_txpool_pub> full_txpool_pub::from_json(std::string&& source)
{
return wire::json::from_bytes<full_txpool_pub>(std::move(source));
full_txpool_pub out{};
std::error_code err = wire::json::from_bytes(std::move(source), out);
if (err)
return err;
return {std::move(out)};
}
static void read_bytes(wire::json_reader& source, full_txpool_pub& self)

View file

@ -314,7 +314,10 @@ namespace lws
return false;
}
auto txpool = MONERO_UNWRAP(wire::json::from_bytes<rpc::json<rpc::get_transaction_pool>::response>(std::move(*resp)));
rpc::json<rpc::get_transaction_pool>::response txpool{};
const std::error_code err = wire::json::from_bytes(std::move(*resp), txpool);
if (err)
MONERO_THROW(err, "Invalid json-rpc");
for (auto& tx : txpool.result.transactions)
txpool_.emplace(get_transaction_prefix_hash(tx.tx), tx.tx_hash);
}