Skip to content

Commit

Permalink
continue on empty tx / input
Browse files Browse the repository at this point in the history
  • Loading branch information
sneurlax committed Feb 8, 2024
1 parent b61592c commit 57a58ed
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/wallets/wallet/impl/bitcoincash_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ class BitcoincashWallet extends Bip39HDWallet
coin: cryptoCurrency.coin,
);

// Check if the getTransaction result is an empty map.
if (tx.isEmpty) {
continue;
}

// check for duplicates before adding to list
if (allTransactions
.indexWhere((e) => e["txid"] == tx["txid"] as String) ==
Expand Down Expand Up @@ -174,6 +179,11 @@ class BitcoincashWallet extends Bip39HDWallet
coin: cryptoCurrency.coin,
);

// If inputTx is empty, then continue to the next iteration.
if (inputTx.isEmpty) {
continue;
}

try {
final prevOutJson = Map<String, dynamic>.from(
(inputTx["vout"] as List).firstWhere((e) => e["n"] == vout)
Expand Down

0 comments on commit 57a58ed

Please sign in to comment.