mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-12 09:32:33 +00:00
fix: null check on chainTipUpdate
This commit is contained in:
parent
717f7457b5
commit
ea2161010f
1 changed files with 4 additions and 6 deletions
|
@ -814,9 +814,6 @@ abstract class ElectrumWalletBase
|
||||||
await updateUnspent();
|
await updateUnspent();
|
||||||
await updateBalance();
|
await updateBalance();
|
||||||
await updateTransactions();
|
await updateTransactions();
|
||||||
final currentHeight = await electrumClient.getCurrentBlockChainTip();
|
|
||||||
if (currentHeight != null) walletInfo.restoreHeight = currentHeight;
|
|
||||||
rescan(height: walletInfo.restoreHeight);
|
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
print(e.toString());
|
print(e.toString());
|
||||||
_onError?.call(FlutterErrorDetails(
|
_onError?.call(FlutterErrorDetails(
|
||||||
|
@ -829,10 +826,11 @@ abstract class ElectrumWalletBase
|
||||||
});
|
});
|
||||||
await _chainTipUpdateSubject?.close();
|
await _chainTipUpdateSubject?.close();
|
||||||
_chainTipUpdateSubject = electrumClient.chainTipUpdate();
|
_chainTipUpdateSubject = electrumClient.chainTipUpdate();
|
||||||
_chainTipUpdateSubject!.listen((event) async {
|
_chainTipUpdateSubject?.listen((_) async {
|
||||||
try {
|
try {
|
||||||
print(["NEW HEIGHT!", event]);
|
final currentHeight = await electrumClient.getCurrentBlockChainTip();
|
||||||
// _setListeners(walletInfo.restoreHeight, chainTip_setListeners: event);
|
if (currentHeight != null) walletInfo.restoreHeight = currentHeight;
|
||||||
|
_setListeners(walletInfo.restoreHeight, chainTip: currentHeight);
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
print(e.toString());
|
print(e.toString());
|
||||||
_onError?.call(FlutterErrorDetails(
|
_onError?.call(FlutterErrorDetails(
|
||||||
|
|
Loading…
Reference in a new issue