mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-25 19:55:52 +00:00
refresh bitcoin cash cache if it has old data
This commit is contained in:
parent
46d5f26054
commit
2a3997e837
1 changed files with 10 additions and 2 deletions
|
@ -2113,7 +2113,16 @@ class BitcoinCashWallet extends CoinServiceAPI {
|
||||||
if (txHeight > 0 &&
|
if (txHeight > 0 &&
|
||||||
txHeight < latestTxnBlockHeight - MINIMUM_CONFIRMATIONS) {
|
txHeight < latestTxnBlockHeight - MINIMUM_CONFIRMATIONS) {
|
||||||
if (unconfirmedCachedTransactions[tx["tx_hash"] as String] == null) {
|
if (unconfirmedCachedTransactions[tx["tx_hash"] as String] == null) {
|
||||||
allTxHashes.remove(tx);
|
print(cachedTransactions.findTransaction(tx["tx_hash"] as String));
|
||||||
|
print(unconfirmedCachedTransactions[tx["tx_hash"] as String]);
|
||||||
|
final cachedTx =
|
||||||
|
cachedTransactions.findTransaction(tx["tx_hash"] as String);
|
||||||
|
if (!(cachedTx != null &&
|
||||||
|
addressType(address: cachedTx.address) ==
|
||||||
|
DerivePathType.bip44 &&
|
||||||
|
Bitbox.Address.detectFormat(cachedTx.address) == 1)) {
|
||||||
|
allTxHashes.remove(tx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2122,7 +2131,6 @@ class BitcoinCashWallet extends CoinServiceAPI {
|
||||||
List<Map<String, dynamic>> allTransactions = [];
|
List<Map<String, dynamic>> allTransactions = [];
|
||||||
|
|
||||||
for (final txHash in allTxHashes) {
|
for (final txHash in allTxHashes) {
|
||||||
Logging.instance.log("bch: $txHash", level: LogLevel.Info);
|
|
||||||
final tx = await cachedElectrumXClient.getTransaction(
|
final tx = await cachedElectrumXClient.getTransaction(
|
||||||
txHash: txHash["tx_hash"] as String,
|
txHash: txHash["tx_hash"] as String,
|
||||||
verbose: true,
|
verbose: true,
|
||||||
|
|
Loading…
Reference in a new issue