diff --git a/include/bitcoin/network/channels/channel_rpc.hpp b/include/bitcoin/network/channels/channel_rpc.hpp index 165012ff5..a378d7f30 100644 --- a/include/bitcoin/network/channels/channel_rpc.hpp +++ b/include/bitcoin/network/channels/channel_rpc.hpp @@ -95,7 +95,7 @@ class channel_rpc result_handler&& handler) NOEXCEPT; inline void send_result(rpc::value_t&& result, size_t size_hint, result_handler&& handler) NOEXCEPT; - inline void send_notification(const rpc::string_t& method, + inline void send_notification(rpc::string_t&& method, rpc::params_t&& notification, size_t size_hint, result_handler&& handler) NOEXCEPT; diff --git a/include/bitcoin/network/impl/channels/channel_rpc.ipp b/include/bitcoin/network/impl/channels/channel_rpc.ipp index 2c7d6308c..f15d97ad1 100644 --- a/include/bitcoin/network/impl/channels/channel_rpc.ipp +++ b/include/bitcoin/network/impl/channels/channel_rpc.ipp @@ -241,7 +241,7 @@ inline void CLASS::send_result(rpc::value_t&& result, size_t size_hint, } TEMPLATE -inline void CLASS::send_notification(const rpc::string_t& method, +inline void CLASS::send_notification(rpc::string_t&& method, rpc::params_t&& notification, size_t size_hint, result_handler&& handler) NOEXCEPT { @@ -249,7 +249,7 @@ inline void CLASS::send_notification(const rpc::string_t& method, send(rpc::request_t { .jsonrpc = version_, - .method = method, + .method = std::move(method), .params = std::move(notification) }, size_hint, std::move(handler)); } diff --git a/include/bitcoin/network/impl/protocols/protocol_rpc.ipp b/include/bitcoin/network/impl/protocols/protocol_rpc.ipp index 3ba1a3f55..0cf687e33 100644 --- a/include/bitcoin/network/impl/protocols/protocol_rpc.ipp +++ b/include/bitcoin/network/impl/protocols/protocol_rpc.ipp @@ -70,12 +70,12 @@ inline void CLASS::send_result(rpc::value_t&& result, size_t size_hint, } TEMPLATE -inline void CLASS::send_notification(const rpc::string_t& method, +inline void CLASS::send_notification(rpc::string_t&& method, rpc::params_t&& notification, size_t size_hint, result_handler&& handler) NOEXCEPT { - channel_->send_notification(method, std::move(notification), size_hint, - std::move(handler)); + channel_->send_notification(std::move(method), std::move(notification), + size_hint, std::move(handler)); } } // namespace network diff --git a/include/bitcoin/network/protocols/protocol_rpc.hpp b/include/bitcoin/network/protocols/protocol_rpc.hpp index c43725dfc..b5b1ed10f 100644 --- a/include/bitcoin/network/protocols/protocol_rpc.hpp +++ b/include/bitcoin/network/protocols/protocol_rpc.hpp @@ -61,7 +61,7 @@ class protocol_rpc result_handler&& handler) NOEXCEPT; virtual inline void send_result(rpc::value_t&& result, size_t size_hint, result_handler&& handler) NOEXCEPT; - virtual inline void send_notification(const rpc::string_t& method, + virtual inline void send_notification(rpc::string_t&& method, rpc::params_t&& notification, size_t size_hint, result_handler&& handler) NOEXCEPT;