Skip to content

Commit

Permalink
refactor: use IsPlatformTransfer in core_write and rpc/blockchain
Browse files Browse the repository at this point in the history
  • Loading branch information
knst committed Oct 22, 2024
1 parent f6169fa commit b9a46f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<CAssetUnlockPayload>(tx))->getFee();
}
CHECK_NONFATAL(MoneyRange(fee));
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<CAssetUnlockPayload>(*tx))->getFee();
}

Expand Down

0 comments on commit b9a46f6

Please sign in to comment.