Merge pull request #3387 from nanocurrency/fix_wallet_pending
wallet_pending and accounts_pending handle empty results differently
This commit is contained in:
commit
0a95131229
2 changed files with 13 additions and 2 deletions
|
@ -1002,7 +1002,10 @@ void nano::json_handler::accounts_pending ()
|
|||
});
|
||||
}
|
||||
}
|
||||
pending.add_child (account.to_account (), peers_l);
|
||||
if (!peers_l.empty ())
|
||||
{
|
||||
pending.add_child (account.to_account (), peers_l);
|
||||
}
|
||||
}
|
||||
}
|
||||
response_l.add_child ("blocks", pending);
|
||||
|
|
|
@ -142,7 +142,15 @@ boost::property_tree::ptree wait_response (nano::system & system, std::shared_pt
|
|||
void check_block_response_count (nano::system & system, std::shared_ptr<nano::rpc> const & rpc, boost::property_tree::ptree & request, uint64_t size_count)
|
||||
{
|
||||
auto response (wait_response (system, rpc, request));
|
||||
ASSERT_EQ (size_count, response.get_child ("blocks").front ().second.size ());
|
||||
auto & blocks = response.get_child ("blocks");
|
||||
if (size_count > 0)
|
||||
{
|
||||
ASSERT_EQ (size_count, blocks.front ().second.size ());
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT_TRUE (blocks.empty ());
|
||||
}
|
||||
}
|
||||
|
||||
class scoped_io_thread_name_change
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue