From 0ce03500393add8978e1410b1b57aed541be09ac Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 21 Nov 2024 12:13:22 -0600 Subject: [PATCH] fix parsing of coinbase utxos --- .../wallet_mixin_interfaces/electrumx_interface.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart index b542f071c..62f0e2255 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart @@ -1190,6 +1190,9 @@ mixin ElectrumXInterface cryptoCurrency: cryptoCurrency, ); + final inputs = txn["vin"] as List? ?? []; + final isCoinbase = inputs.any((e) => (e as Map?)?["coinbase"] != null); + final vout = jsonUTXO["tx_pos"] as int; final outputs = txn["vout"] as List; @@ -1221,7 +1224,10 @@ mixin ElectrumXInterface name: checkBlockResult.utxoLabel ?? "", isBlocked: checkBlockResult.blocked, blockedReason: checkBlockResult.blockedReason, - isCoinbase: txn["is_coinbase"] as bool? ?? false, + isCoinbase: txn["is_coinbase"] as bool? ?? + txn["is-coinbase"] as bool? ?? + txn["iscoinbase"] as bool? ?? + isCoinbase, blockHash: txn["blockhash"] as String?, blockHeight: jsonUTXO["height"] as int?, blockTime: txn["blocktime"] as int?,