refactor: use IsPlatformTransfer in core_write and rpc/blockchain

This commit is contained in:
Konstantin Akimov 2024-10-22 21:48:05 +07:00
parent f6169fade4
commit b9a46f6d2c
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524
2 changed files with 2 additions and 2 deletions

View File

@ -335,7 +335,7 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, bool include_add
if (calculate_fee) { if (calculate_fee) {
CAmount fee = amt_total_in - amt_total_out; CAmount fee = amt_total_in - amt_total_out;
if (tx.nType == TRANSACTION_ASSET_UNLOCK) { if (tx.IsPlatformTransfer()) {
fee = CHECK_NONFATAL(GetTxPayload<CAssetUnlockPayload>(tx))->getFee(); fee = CHECK_NONFATAL(GetTxPayload<CAssetUnlockPayload>(tx))->getFee();
} }
CHECK_NONFATAL(MoneyRange(fee)); CHECK_NONFATAL(MoneyRange(fee));

View File

@ -2452,7 +2452,7 @@ static RPCHelpMan getblockstats()
CAmount txfee = tx_total_in - tx_total_out; CAmount txfee = tx_total_in - tx_total_out;
if (tx->nType == TRANSACTION_ASSET_UNLOCK) { if (tx->IsPlatformTransfer()) {
txfee = CHECK_NONFATAL(GetTxPayload<CAssetUnlockPayload>(*tx))->getFee(); txfee = CHECK_NONFATAL(GetTxPayload<CAssetUnlockPayload>(*tx))->getFee();
} }