Skip to content

Commit

Permalink
Add option to include active in RPC *_pending
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower authored and clemahieu committed Aug 7, 2018
1 parent 06501b1 commit c58c40b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rai/node/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool> ("source", false);
const bool include_active = request.get<bool> ("include_active", false);
boost::property_tree::ptree pending;
rai::transaction transaction (node.store.environment, nullptr, false);
for (auto & accounts : request.get_child ("accounts"))
Expand All @@ -771,7 +772,7 @@ void rai::rpc_handler::accounts_pending ()
rai::pending_key key (i->first);
std::shared_ptr<rai::block> 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)
{
Expand Down Expand Up @@ -3116,6 +3117,7 @@ void rai::rpc_handler::wallet_pending ()
auto threshold (threshold_optional_impl ());
const bool source = request.get<bool> ("source", false);
const bool min_version = request.get<bool> ("min_version", false);
const bool include_active = request.get<bool> ("include_active", false);
if (!ec)
{
boost::property_tree::ptree pending;
Expand All @@ -3130,7 +3132,7 @@ void rai::rpc_handler::wallet_pending ()
rai::pending_key key (ii->first);
std::shared_ptr<rai::block> 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)
{
Expand Down

0 comments on commit c58c40b

Please sign in to comment.