From c58c40b6779c11b05111634ac095fe73acdb18b4 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Mon, 6 Aug 2018 10:50:21 -0600 Subject: [PATCH] Add option to include active in RPC *_pending --- rai/node/rpc.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rai/node/rpc.cpp b/rai/node/rpc.cpp index 877a044c..04064737 100644 --- a/rai/node/rpc.cpp +++ b/rai/node/rpc.cpp @@ -757,6 +757,7 @@ void rai::rpc_handler::accounts_pending () auto count (count_optional_impl ()); auto threshold (threshold_optional_impl ()); const bool source = request.get ("source", false); + const bool include_active = request.get ("include_active", false); boost::property_tree::ptree pending; rai::transaction transaction (node.store.environment, nullptr, false); for (auto & accounts : request.get_child ("accounts")) @@ -771,7 +772,7 @@ void rai::rpc_handler::accounts_pending () rai::pending_key key (i->first); std::shared_ptr block (node.store.block_get (transaction, key.hash)); assert (block); - if (block && !node.active.active (*block)) + if (include_active || (block && !node.active.active (*block))) { if (threshold.is_zero () && !source) { @@ -3116,6 +3117,7 @@ void rai::rpc_handler::wallet_pending () auto threshold (threshold_optional_impl ()); const bool source = request.get ("source", false); const bool min_version = request.get ("min_version", false); + const bool include_active = request.get ("include_active", false); if (!ec) { boost::property_tree::ptree pending; @@ -3130,7 +3132,7 @@ void rai::rpc_handler::wallet_pending () rai::pending_key key (ii->first); std::shared_ptr block (node.store.block_get (transaction, key.hash)); assert (block); - if (block && !node.active.active (*block)) + if (include_active || (block && !node.active.active (*block))) { if (threshold.is_zero () && !source) {