From b9a46f6d2c14a07803cc26cf79b3a0d97fe8e486 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Tue, 22 Oct 2024 21:48:05 +0700 Subject: [PATCH] refactor: use IsPlatformTransfer in core_write and rpc/blockchain --- src/core_write.cpp | 2 +- src/rpc/blockchain.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core_write.cpp b/src/core_write.cpp index 8999f9406f..2edee784bb 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -335,7 +335,7 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, bool include_add if (calculate_fee) { CAmount fee = amt_total_in - amt_total_out; - if (tx.nType == TRANSACTION_ASSET_UNLOCK) { + if (tx.IsPlatformTransfer()) { fee = CHECK_NONFATAL(GetTxPayload(tx))->getFee(); } CHECK_NONFATAL(MoneyRange(fee)); diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index fe44b5f2c3..409d24c879 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2452,7 +2452,7 @@ static RPCHelpMan getblockstats() CAmount txfee = tx_total_in - tx_total_out; - if (tx->nType == TRANSACTION_ASSET_UNLOCK) { + if (tx->IsPlatformTransfer()) { txfee = CHECK_NONFATAL(GetTxPayload(*tx))->getFee(); }