Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/core_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, bool include_add
if (calculate_fee) {
CAmount fee = amt_total_in - amt_total_out;
if (tx.IsPlatformTransfer()) {
fee = CHECK_NONFATAL(GetTxPayload<CAssetUnlockPayload>(tx))->getFee();
auto payload = GetTxPayload<CAssetUnlockPayload>(tx);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing const

Suggested change
auto payload = GetTxPayload<CAssetUnlockPayload>(tx);
const auto payload = GetTxPayload<CAssetUnlockPayload>(tx);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for other parts

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meh, it'll be reverted in develop, and compiler can figure that out for this one version :)

CHECK_NONFATAL(payload);
fee = payload->getFee();
}
CHECK_NONFATAL(MoneyRange(fee));
entry.pushKV("fee", ValueFromAmount(fee));
Expand Down
4 changes: 3 additions & 1 deletion src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2453,7 +2453,9 @@ static RPCHelpMan getblockstats()
CAmount txfee = tx_total_in - tx_total_out;

if (tx->IsPlatformTransfer()) {
txfee = CHECK_NONFATAL(GetTxPayload<CAssetUnlockPayload>(*tx))->getFee();
auto payload = GetTxPayload<CAssetUnlockPayload>(*tx);
CHECK_NONFATAL(payload);
txfee = payload->getFee();
}

CHECK_NONFATAL(MoneyRange(txfee));
Expand Down
4 changes: 3 additions & 1 deletion src/rpc/masternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,9 @@ static RPCHelpMan masternode_payments()
continue;
}
if (tx->IsPlatformTransfer()) {
nBlockFees += CHECK_NONFATAL(GetTxPayload<CAssetUnlockPayload>(*tx))->getFee();
auto payload = GetTxPayload<CAssetUnlockPayload>(*tx);
CHECK_NONFATAL(payload);
nBlockFees += payload->getFee();
continue;
}

Expand Down
Loading