Skip to content

Commit ab7172b

Browse files
committed
fix: getblockstats rpc to work with withdrawal transactions
1 parent 96c9b46 commit ab7172b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/rpc/blockchain.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <versionbits.h>
5050
#include <warnings.h>
5151

52+
#include <evo/assetlocktx.h>
5253
#include <evo/cbtx.h>
5354
#include <evo/evodb.h>
5455
#include <evo/mnhftx.h>
@@ -2450,6 +2451,11 @@ static RPCHelpMan getblockstats()
24502451
}
24512452

24522453
CAmount txfee = tx_total_in - tx_total_out;
2454+
2455+
if (tx->nType == TRANSACTION_ASSET_UNLOCK) {
2456+
txfee = CHECK_NONFATAL(GetTxPayload<CAssetUnlockPayload>(*tx))->getFee();
2457+
}
2458+
24532459
CHECK_NONFATAL(MoneyRange(txfee));
24542460
if (do_medianfee) {
24552461
fee_array.push_back(txfee);

0 commit comments

Comments
 (0)