trusted nodes fix and possibly other node fix

This commit is contained in:
julian 2023-01-20 16:24:33 -06:00
parent 017719971b
commit a391a76eec
2 changed files with 48 additions and 8 deletions

View file

@ -381,7 +381,12 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
final node = await _getCurrentNode();
final host = Uri.parse(node.host).host;
await walletBase!.connectToNode(
node: Node(uri: "$host:${node.port}", type: WalletType.monero));
node: Node(
uri: "$host:${node.port}",
type: WalletType.monero,
trusted: node.trusted ?? false,
),
);
await walletBase!.startSync();
await Future.wait([
@ -603,7 +608,12 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
final node = await _getCurrentNode();
final host = Uri.parse(node.host).host;
await walletBase!.connectToNode(
node: Node(uri: "$host:${node.port}", type: WalletType.monero));
node: Node(
uri: "$host:${node.port}",
type: WalletType.monero,
trusted: node.trusted ?? false,
),
);
await walletBase!.rescan(height: credentials.height);
walletBase!.close();
} catch (e, s) {
@ -690,7 +700,12 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
final node = await _getCurrentNode();
final host = Uri.parse(node.host).host;
await walletBase?.connectToNode(
node: Node(uri: "$host:${node.port}", type: WalletType.monero));
node: Node(
uri: "$host:${node.port}",
type: WalletType.monero,
trusted: node.trusted ?? false,
),
);
}
await walletBase?.startSync();
await refresh();
@ -782,7 +797,12 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
final host = Uri.parse(node.host).host;
await walletBase?.connectToNode(
node: Node(uri: "$host:${node.port}", type: WalletType.monero));
node: Node(
uri: "$host:${node.port}",
type: WalletType.monero,
trusted: node.trusted ?? false,
),
);
// TODO: is this sync call needed? Do we need to notify ui here?
await walletBase?.startSync();

View file

@ -389,7 +389,12 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
final node = await _getCurrentNode();
final host = Uri.parse(node.host).host;
await walletBase?.connectToNode(
node: Node(uri: "$host:${node.port}", type: WalletType.wownero));
node: Node(
uri: "$host:${node.port}",
type: WalletType.wownero,
trusted: node.trusted ?? false,
),
);
await walletBase?.startSync();
await Future.wait([
updateCachedId(walletId),
@ -614,7 +619,12 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
final node = await _getCurrentNode();
final host = Uri.parse(node.host).host;
await walletBase?.connectToNode(
node: Node(uri: "$host:${node.port}", type: WalletType.wownero));
node: Node(
uri: "$host:${node.port}",
type: WalletType.wownero,
trusted: node.trusted ?? false,
),
);
await walletBase?.rescan(height: credentials.height);
walletBase?.close();
} catch (e, s) {
@ -701,7 +711,12 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
final node = await _getCurrentNode();
final host = Uri.parse(node.host).host;
await walletBase?.connectToNode(
node: Node(uri: "$host:${node.port}", type: WalletType.monero));
node: Node(
uri: "$host:${node.port}",
type: WalletType.wownero,
trusted: node.trusted ?? false,
),
);
}
await walletBase?.startSync();
await refresh();
@ -790,7 +805,12 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
final host = Uri.parse(node.host).host;
await walletBase?.connectToNode(
node: Node(uri: "$host:${node.port}", type: WalletType.monero));
node: Node(
uri: "$host:${node.port}",
type: WalletType.wownero,
trusted: node.trusted ?? false,
),
);
// TODO: is this sync call needed? Do we need to notify ui here?
await walletBase?.startSync();