diff --git a/rai/node/rpc.cpp b/rai/node/rpc.cpp index e23ede55..6d0aaeaf 100644 --- a/rai/node/rpc.cpp +++ b/rai/node/rpc.cpp @@ -773,8 +773,7 @@ void rai::rpc_handler::accounts_pending () for (auto i (node.store.pending_begin (transaction, rai::pending_key (account, 0))), n (node.store.pending_begin (transaction, rai::pending_key (end, 0))); i != n && peers_l.size () < count; ++i) { rai::pending_key key (i->first); - std::shared_ptr block (node.store.block_get (transaction, key.hash)); - assert (block); + std::shared_ptr block (include_active ? nullptr : node.store.block_get (transaction, key.hash)); if (include_active || (block && !node.active.active (*block))) { if (threshold.is_zero () && !source) @@ -2073,8 +2072,7 @@ void rai::rpc_handler::pending () for (auto i (node.store.pending_begin (transaction, rai::pending_key (account, 0))), n (node.store.pending_begin (transaction, rai::pending_key (end, 0))); i != n && peers_l.size () < count; ++i) { rai::pending_key key (i->first); - std::shared_ptr block (node.store.block_get (transaction, key.hash)); - assert (block); + std::shared_ptr block (include_active ? nullptr : node.store.block_get (transaction, key.hash)); if (include_active || (block && !node.active.active (*block))) { if (threshold.is_zero () && !source && !min_version) @@ -3262,8 +3260,7 @@ void rai::rpc_handler::wallet_pending () for (auto ii (node.store.pending_begin (transaction, rai::pending_key (account, 0))), nn (node.store.pending_begin (transaction, rai::pending_key (end, 0))); ii != nn && peers_l.size () < count; ++ii) { rai::pending_key key (ii->first); - std::shared_ptr block (node.store.block_get (transaction, key.hash)); - assert (block); + std::shared_ptr block (include_active ? nullptr : node.store.block_get (transaction, key.hash)); if (include_active || (block && !node.active.active (*block))) { if (threshold.is_zero () && !source)