mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-03 17:29:23 +00:00
Merge pull request #771 from cypherstack/bch_amount_parsing
Bch amount parsing
This commit is contained in:
commit
7d9b113b46
1 changed files with 22 additions and 20 deletions
|
@ -119,28 +119,28 @@ class BitcoincashWallet extends Bip39HDWallet
|
||||||
List<Map<String, dynamic>> allTransactions = [];
|
List<Map<String, dynamic>> allTransactions = [];
|
||||||
|
|
||||||
for (final txHash in allTxHashes) {
|
for (final txHash in allTxHashes) {
|
||||||
final storedTx = await mainDB.isar.transactionV2s
|
// final storedTx = await mainDB.isar.transactionV2s
|
||||||
.where()
|
// .where()
|
||||||
.txidWalletIdEqualTo(txHash["tx_hash"] as String, walletId)
|
// .txidWalletIdEqualTo(txHash["tx_hash"] as String, walletId)
|
||||||
.findFirst();
|
// .findFirst();
|
||||||
|
//
|
||||||
|
// if (storedTx == null ||
|
||||||
|
// storedTx.height == null ||
|
||||||
|
// (storedTx.height != null && storedTx.height! <= 0)) {
|
||||||
|
final tx = await electrumXCachedClient.getTransaction(
|
||||||
|
txHash: txHash["tx_hash"] as String,
|
||||||
|
verbose: true,
|
||||||
|
coin: cryptoCurrency.coin,
|
||||||
|
);
|
||||||
|
|
||||||
if (storedTx == null ||
|
// check for duplicates before adding to list
|
||||||
storedTx.height == null ||
|
if (allTransactions
|
||||||
(storedTx.height != null && storedTx.height! <= 0)) {
|
.indexWhere((e) => e["txid"] == tx["txid"] as String) ==
|
||||||
final tx = await electrumXCachedClient.getTransaction(
|
-1) {
|
||||||
txHash: txHash["tx_hash"] as String,
|
tx["height"] = txHash["height"];
|
||||||
verbose: true,
|
allTransactions.add(tx);
|
||||||
coin: cryptoCurrency.coin,
|
|
||||||
);
|
|
||||||
|
|
||||||
// check for duplicates before adding to list
|
|
||||||
if (allTransactions
|
|
||||||
.indexWhere((e) => e["txid"] == tx["txid"] as String) ==
|
|
||||||
-1) {
|
|
||||||
tx["height"] = txHash["height"];
|
|
||||||
allTransactions.add(tx);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<TransactionV2> txns = [];
|
final List<TransactionV2> txns = [];
|
||||||
|
@ -182,6 +182,7 @@ class BitcoincashWallet extends Bip39HDWallet
|
||||||
prevOutJson,
|
prevOutJson,
|
||||||
decimalPlaces: cryptoCurrency.fractionDigits,
|
decimalPlaces: cryptoCurrency.fractionDigits,
|
||||||
walletOwns: false, // doesn't matter here as this is not saved
|
walletOwns: false, // doesn't matter here as this is not saved
|
||||||
|
isFullAmountNotSats: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
outpoint = OutpointV2.isarCantDoRequiredInDefaultConstructor(
|
outpoint = OutpointV2.isarCantDoRequiredInDefaultConstructor(
|
||||||
|
@ -227,6 +228,7 @@ class BitcoincashWallet extends Bip39HDWallet
|
||||||
decimalPlaces: cryptoCurrency.fractionDigits,
|
decimalPlaces: cryptoCurrency.fractionDigits,
|
||||||
// don't know yet if wallet owns. Need addresses first
|
// don't know yet if wallet owns. Need addresses first
|
||||||
walletOwns: false,
|
walletOwns: false,
|
||||||
|
isFullAmountNotSats: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
// if output was to my wallet, add value to amount received
|
// if output was to my wallet, add value to amount received
|
||||||
|
|
Loading…
Reference in a new issue