@@ -68,7 +68,8 @@ class BCN_API protocol_bitcoind_rpc
6868 bool handle_get_best_block_hash (const code& ec,
6969 rpc_interface::get_best_block_hash) NOEXCEPT;
7070 bool handle_get_block (const code& ec,
71- rpc_interface::get_block, const std::string&, double ) NOEXCEPT;
71+ rpc_interface::get_block, const std::string&,
72+ double verbosity) NOEXCEPT;
7273 bool handle_get_block_chain_info (const code& ec,
7374 rpc_interface::get_block_chain_info) NOEXCEPT;
7475 bool handle_get_block_count (const code& ec,
@@ -104,18 +105,38 @@ class BCN_API protocol_bitcoind_rpc
104105 bool handle_verify_tx_out_set (const code& ec,
105106 rpc_interface::verify_tx_out_set, const std::string&) NOEXCEPT;
106107
108+ // / Senders.
109+ void send_error (const code& ec) NOEXCEPT;
110+ void send_error (const code& ec, size_t size_hint) NOEXCEPT;
111+ void send_error (const code& ec, network::rpc::value_option&& error,
112+ size_t size_hint) NOEXCEPT;
113+ void send_text (std::string&& hexidecimal) NOEXCEPT;
114+ void send_result (network::rpc::value_option&& result,
115+ size_t size_hint) NOEXCEPT;
116+
107117private:
108118 template <class Derived , typename Method, typename ... Args>
109119 inline void subscribe (Method&& method, Args&&... args) NOEXCEPT
110120 {
111121 rpc_dispatcher_.subscribe (BIND_SHARED (method, args));
112122 }
113123
114- // Send the response.
115- void send_json (boost::json::value&& model, size_t size_hint) NOEXCEPT;
124+ // Senders.
125+ void send_rpc (network::rpc::response_t && model,
126+ size_t size_hint) NOEXCEPT;
127+
128+ // Cache request for serialization (requires strand).
129+ void set_rpc_request (network::rpc::version version,
130+ const network::rpc::id_option& id,
131+ const network::http::request_cptr& request) NOEXCEPT;
132+
133+ // Obtain cached request and clear cache (requires strand).
134+ network::http::request_cptr reset_rpc_request () NOEXCEPT;
116135
117- // This is protected by strand.
136+ // These are protected by strand.
118137 rpc_dispatcher rpc_dispatcher_{};
138+ network::rpc::version version_{};
139+ network::rpc::id_option id_{};
119140};
120141
121142} // namespace node
0 commit comments