From 6cafb1cf13210ea7eff55c879ba5ce6ec5dda530 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Thu, 18 Dec 2025 04:25:43 -0500 Subject: [PATCH] Read pcin_value from bitcoind.rpc message. --- src/protocols/protocol_bitcoind_rpc.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/protocols/protocol_bitcoind_rpc.cpp b/src/protocols/protocol_bitcoind_rpc.cpp index 54025fda..0e434dd5 100644 --- a/src/protocols/protocol_bitcoind_rpc.cpp +++ b/src/protocols/protocol_bitcoind_rpc.cpp @@ -31,6 +31,7 @@ namespace node { using namespace system; using namespace network::rpc; using namespace network::http; +using namespace network::monad; using namespace std::placeholders; using namespace boost::json; @@ -130,32 +131,17 @@ void protocol_bitcoind_rpc::handle_receive_post(const code& ec, } const auto& body = post->body(); - if (!body.contains()) + if (!body.contains()) { send_not_acceptable(*post); return; } - request_t request{}; - try - { - request = value_to(body.get().model); - } - catch (const boost::system::system_error& e) - { - send_bad_target(e.code(), *post); - return; - } - catch (...) - { - send_bad_target(error::unexpected_parse, *post); - return; - } - // The post is saved off during asynchonous handling and used in send_json // to formulate response headers, isolating handlers from http semantics. set_request(post); + const auto& request = body.get().message; if (const auto code = rpc_dispatcher_.notify(request)) stop(code); }