From 313b6c10aace1acdeaaa512c56e3effb0fbb8f06 Mon Sep 17 00:00:00 2001 From: JimmyShi22 <417711026@qq.com> Date: Mon, 29 Jan 2024 21:08:29 +0800 Subject: [PATCH] opt --- .../src/executive/BillingTransactionExecutive.cpp | 6 ++++++ bcos-executor/src/executive/TransactionExecutive.cpp | 7 +------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bcos-executor/src/executive/BillingTransactionExecutive.cpp b/bcos-executor/src/executive/BillingTransactionExecutive.cpp index 7597dbdfe4..69fc18dae0 100644 --- a/bcos-executor/src/executive/BillingTransactionExecutive.cpp +++ b/bcos-executor/src/executive/BillingTransactionExecutive.cpp @@ -34,6 +34,12 @@ CallParameters::UniquePtr BillingTransactionExecutive::start(CallParameters::Uni << LOG_KV("gasUsed", gasUsed) << LOG_KV("gasPrice", gasPrice) << LOG_KV("origin", currentSenderAddr); auto subBalanceRet = callPrecompiled(std::move(callParam4AccountPre)); + /* leave this code for future use + auto subBalanceRet = externalRequest(shared_from_this(), ref(callParam4AccountPre->data), + currentSenderAddr, callParam4AccountPre->senderAddress, + callParam4AccountPre->receiveAddress, false, false, + message->gas, true); + */ if (subBalanceRet->type == CallParameters::REVERT) { message->type = subBalanceRet->type; diff --git a/bcos-executor/src/executive/TransactionExecutive.cpp b/bcos-executor/src/executive/TransactionExecutive.cpp index c8924e6277..b1c5f81a26 100644 --- a/bcos-executor/src/executive/TransactionExecutive.cpp +++ b/bcos-executor/src/executive/TransactionExecutive.cpp @@ -337,12 +337,7 @@ bool TransactionExecutive::transferBalance(std::string_view origin, std::string_ << LOG_KV("addAccount", receiver) << LOG_KV("receiveAddress", ACCOUNT_ADDRESS) << LOG_KV("value", value) << LOG_KV("gas", gas); - if (isPrecompiled(std::string(receiver))) - { - EXECUTIVE_LOG(DEBUG) << LOG_BADGE("Execute") - << "transferBalance, receiverAddress is precompiled address"; - return false; - } + // first subAccountBalance, then addAccountBalance // sender = sender - value auto codec = CodecWrapper(m_blockContext.hashHandler(), m_blockContext.isWasm());