mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-12 09:32:33 +00:00
Some more fixes
This commit is contained in:
parent
8964774c51
commit
b39b2bbb99
3 changed files with 9 additions and 8 deletions
|
@ -792,7 +792,6 @@ abstract class ElectrumWalletBase
|
|||
coin.isFrozen = coinInfo.isFrozen;
|
||||
coin.isSending = coinInfo.isSending;
|
||||
coin.note = coinInfo.note;
|
||||
coin.bitcoinAddressRecord.balance += coinInfo.value;
|
||||
} else {
|
||||
_addCoinInfo(coin);
|
||||
}
|
||||
|
|
|
@ -133,6 +133,7 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store {
|
|||
final stub = await CwMweb.stub();
|
||||
Timer.periodic(
|
||||
const Duration(milliseconds: 1500), (timer) async {
|
||||
if (syncStatus is FailedSyncStatus) return;
|
||||
final height = await electrumClient.getCurrentBlockChainTip() ?? 0;
|
||||
final resp = await stub.status(StatusRequest());
|
||||
if (resp.blockHeaderHeight < height) {
|
||||
|
@ -145,10 +146,10 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store {
|
|||
syncStatus = SyncingSyncStatus(1, 0.999);
|
||||
} else {
|
||||
syncStatus = SyncedSyncStatus();
|
||||
}
|
||||
if (resp.mwebUtxosHeight > mwebUtxosHeight) {
|
||||
mwebUtxosHeight = resp.mwebUtxosHeight;
|
||||
await checkMwebUtxosSpent();
|
||||
if (resp.mwebUtxosHeight > mwebUtxosHeight) {
|
||||
mwebUtxosHeight = resp.mwebUtxosHeight;
|
||||
await checkMwebUtxosSpent();
|
||||
}
|
||||
}
|
||||
});
|
||||
processMwebUtxos();
|
||||
|
@ -192,7 +193,7 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store {
|
|||
tx.height = utxo.height;
|
||||
tx.isPending = utxo.height == 0;
|
||||
tx.confirmations = confirmations;
|
||||
if (transactionHistory.transactions[utxo.outputId] == null) {
|
||||
if (transactionHistory.transactions[tx.id] == null) {
|
||||
final addressRecord = walletAddresses.allAddresses.firstWhere(
|
||||
(addressRecord) => addressRecord.address == utxo.address);
|
||||
addressRecord.txCount++;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:grpc/grpc.dart';
|
||||
import 'package:cw_bitcoin/exceptions.dart';
|
||||
import 'package:bitcoin_base/bitcoin_base.dart';
|
||||
import 'package:blockchain_utils/blockchain_utils.dart';
|
||||
|
@ -91,8 +92,8 @@ class PendingBitcoinTransaction with PendingTransaction {
|
|||
final stub = await CwMweb.stub();
|
||||
final resp = await stub.broadcast(BroadcastRequest(rawTx: BytesUtils.fromHexString(hex)));
|
||||
idOverride = resp.txid;
|
||||
} catch (e) {
|
||||
throw BitcoinTransactionCommitFailed();
|
||||
} on GrpcError catch (e) {
|
||||
throw BitcoinTransactionCommitFailed(errorMessage: e.message);
|
||||
} else {
|
||||
await _commit();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue