Skip to content

Commit

Permalink
Improve performance of account history wallet APIs
Browse files Browse the repository at this point in the history
By using the block_time field in operation_history_object.
  • Loading branch information
abitmore committed Sep 16, 2022
1 parent d07cb03 commit 499eec7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions libraries/wallet/wallet_results.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ std::map<string,std::function<string(fc::variant,const fc::variants&)>> wallet_a
for( operation_detail& d : r )
{
operation_history_object& i = d.op;
auto b = _remote_db->get_block_header(i.block_num);
FC_ASSERT(b);
ss << i.block_num << " ";
ss << b->timestamp.to_iso_string() << " ";
ss << i.block_time.to_iso_string() << " ";
i.op.visit(operation_printer(ss, *this, i));
ss << " \n";
}
Expand All @@ -70,10 +68,8 @@ std::map<string,std::function<string(fc::variant,const fc::variants&)>> wallet_a
ss << "result_count : " << r.result_count << " \n";
for (operation_detail_ex& d : r.details) {
operation_history_object& i = d.op;
auto b = _remote_db->get_block_header(i.block_num);
FC_ASSERT(b);
ss << i.block_num << " ";
ss << b->timestamp.to_iso_string() << " ";
ss << i.block_time.to_iso_string() << " ";
i.op.visit(operation_printer(ss, *this, i));
ss << " transaction_id : ";
ss << d.transaction_id.str();
Expand Down

0 comments on commit 499eec7

Please sign in to comment.