diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 411d6cb75d..fe44b5f2c3 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -49,6 +49,7 @@ #include #include +#include #include #include #include @@ -2450,6 +2451,11 @@ static RPCHelpMan getblockstats() } CAmount txfee = tx_total_in - tx_total_out; + + if (tx->nType == TRANSACTION_ASSET_UNLOCK) { + txfee = CHECK_NONFATAL(GetTxPayload(*tx))->getFee(); + } + CHECK_NONFATAL(MoneyRange(txfee)); if (do_medianfee) { fee_array.push_back(txfee);