mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-09-04 18:14:23 -05:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user