From 940b158c2a5952610f0faa3d1ace2e5b8f746479 Mon Sep 17 00:00:00 2001 From: liukunyu Date: Fri, 30 Nov 2018 14:34:06 +0800 Subject: [PATCH] fix: fix get_require_fees crash --- libraries/app/database_api_impl.cpp | 8 ++++++++ libraries/chain/wasm_interface.cpp | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libraries/app/database_api_impl.cpp b/libraries/app/database_api_impl.cpp index 590b6b06..609ff3d9 100644 --- a/libraries/app/database_api_impl.cpp +++ b/libraries/app/database_api_impl.cpp @@ -1283,6 +1283,12 @@ vector< fc::variant > database_api_impl::get_required_fees( const vector::value) { @@ -1327,6 +1333,8 @@ vector< fc::variant > database_api_impl::get_required_fees( const vector data, size_t buffer_size) { const transaction* cur_trx = context.db().get_cur_trx(); - FC_ASSERT(nullptr != cur_trx, "cur_trx is null"); + FC_ASSERT(nullptr != cur_trx, "current transaction not set"); bytes trx = fc::raw::pack(*cur_trx); auto s = trx.size(); @@ -1097,6 +1097,7 @@ class context_free_transaction_api : public context_aware_api { int transaction_size() { const transaction* trx = context.db().get_cur_trx(); + FC_ASSERT(nullptr != trx, "current transaction not set"); return fc::raw::pack(*trx).size(); }