Merge pull request #12060 from Chia-Network/mh.get_coin_state_during_sync

Go to untrusted peers for coin state if trusted isn't synced
This commit is contained in:
William Allen
2022-06-27 10:04:20 -05:00
committed by GitHub
+3 -2
View File
@@ -1450,13 +1450,14 @@ class WalletNode:
if len(all_nodes.keys()) == 0:
raise ValueError("Not connected to the full node")
# Use supplied if provided, prioritize trusted otherwise
synced_peers = [node for node in all_nodes.values() if node.peer_node_id in self.synced_peers]
if peer is None:
for node in list(all_nodes.values()):
for node in synced_peers:
if self.is_trusted(node):
peer = node
break
if peer is None:
peer = list(all_nodes.values())[0]
peer = synced_peers[0]
assert peer is not None
msg = wallet_protocol.RegisterForCoinUpdates(coin_names, uint32(0))