From 499eec7f83b99a6410d487a7f61913cd6e02c616 Mon Sep 17 00:00:00 2001 From: abitmore Date: Fri, 16 Sep 2022 18:58:49 +0000 Subject: [PATCH] Improve performance of account history wallet APIs By using the block_time field in operation_history_object. --- libraries/wallet/wallet_results.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libraries/wallet/wallet_results.cpp b/libraries/wallet/wallet_results.cpp index 3f881d4138..6e96e19f80 100644 --- a/libraries/wallet/wallet_results.cpp +++ b/libraries/wallet/wallet_results.cpp @@ -49,10 +49,8 @@ std::map> 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"; } @@ -70,10 +68,8 @@ std::map> 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();