mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 01:37:54 +00:00
add logging
This commit is contained in:
parent
3d942f3e0b
commit
d00c205e6c
2 changed files with 8 additions and 6 deletions
|
@ -47,13 +47,13 @@ class CachedElectrumXClient {
|
||||||
/// If the client is closed, use the callback to update it.
|
/// If the client is closed, use the callback to update it.
|
||||||
_checkElectrumAdapterClient() async {
|
_checkElectrumAdapterClient() async {
|
||||||
if (electrumAdapterClient.peer.isClosed) {
|
if (electrumAdapterClient.peer.isClosed) {
|
||||||
|
Logging.instance.log(
|
||||||
|
"ElectrumAdapterClient is closed, reopening it...",
|
||||||
|
level: LogLevel.Info,
|
||||||
|
);
|
||||||
ElectrumClient? _electrumAdapterClient =
|
ElectrumClient? _electrumAdapterClient =
|
||||||
await electrumAdapterUpdateCallback?.call();
|
await electrumAdapterUpdateCallback.call();
|
||||||
if (_electrumAdapterClient != null) {
|
electrumAdapterClient = _electrumAdapterClient;
|
||||||
electrumAdapterClient = _electrumAdapterClient;
|
|
||||||
} else {
|
|
||||||
throw Exception("ElectrumAdapterClient is closed");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1296,6 +1296,8 @@ mixin ElectrumXInterface<T extends Bip39HDCurrency> on Bip39HDWallet<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<ElectrumClient> updateClient() async {
|
Future<ElectrumClient> updateClient() async {
|
||||||
|
Logging.instance.log("Updating electrum node and ElectrumAdapterClient.",
|
||||||
|
level: LogLevel.Info);
|
||||||
await updateNode();
|
await updateNode();
|
||||||
return electrumAdapterClient;
|
return electrumAdapterClient;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue