mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-02-02 19:26:27 +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 updateBalance();
|
||||
await updateTransactions();
|
||||
final currentHeight = await electrumClient.getCurrentBlockChainTip();
|
||||
if (currentHeight != null) walletInfo.restoreHeight = currentHeight;
|
||||
rescan(height: walletInfo.restoreHeight);
|
||||
} catch (e, s) {
|
||||
print(e.toString());
|
||||
_onError?.call(FlutterErrorDetails(
|
||||
|
@ -829,10 +826,11 @@ abstract class ElectrumWalletBase
|
|||
});
|
||||
await _chainTipUpdateSubject?.close();
|
||||
_chainTipUpdateSubject = electrumClient.chainTipUpdate();
|
||||
_chainTipUpdateSubject!.listen((event) async {
|
||||
_chainTipUpdateSubject?.listen((_) async {
|
||||
try {
|
||||
print(["NEW HEIGHT!", event]);
|
||||
// _setListeners(walletInfo.restoreHeight, chainTip_setListeners: event);
|
||||
final currentHeight = await electrumClient.getCurrentBlockChainTip();
|
||||
if (currentHeight != null) walletInfo.restoreHeight = currentHeight;
|
||||
_setListeners(walletInfo.restoreHeight, chainTip: currentHeight);
|
||||
} catch (e, s) {
|
||||
print(e.toString());
|
||||
_onError?.call(FlutterErrorDetails(
|
||||
|
|
Loading…
Reference in a new issue