mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-12-01 11:27:10 +03:00
sets up wallet before running farm summary (#3235)
* sets up wallet before running farm summary * fixes call to summary * moves wallet peers discovery to after backup is initialized
This commit is contained in:
parent
1c808b6c29
commit
880df53f72
@ -47,11 +47,23 @@ def farm_cmd() -> None:
|
||||
default=None,
|
||||
show_default=True,
|
||||
)
|
||||
def summary_cmd(rpc_port: int, wallet_rpc_port: int, harvester_rpc_port: int, farmer_rpc_port: int) -> None:
|
||||
@click.option("-f", "--fingerprint", help="Set the fingerprint to specify which wallet to use", type=int)
|
||||
def summary_cmd(
|
||||
rpc_port: int, wallet_rpc_port: int, harvester_rpc_port: int, farmer_rpc_port: int, fingerprint: int
|
||||
) -> None:
|
||||
from .farm_funcs import summary
|
||||
import asyncio
|
||||
|
||||
asyncio.run(summary(rpc_port, wallet_rpc_port, harvester_rpc_port, farmer_rpc_port))
|
||||
from .wallet_funcs import execute_with_wallet
|
||||
|
||||
asyncio.run(
|
||||
execute_with_wallet(
|
||||
wallet_rpc_port,
|
||||
fingerprint,
|
||||
{},
|
||||
lambda *ignored: summary(rpc_port, wallet_rpc_port, harvester_rpc_port, farmer_rpc_port),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@farm_cmd.command("challenges", short_help="Show the latest challenges")
|
||||
|
@ -194,6 +194,7 @@ class WalletNode:
|
||||
self.sync_task = asyncio.create_task(self.sync_job())
|
||||
self.logged_in_fingerprint = fingerprint
|
||||
self.logged_in = True
|
||||
asyncio.create_task(self.wallet_peers.start())
|
||||
return True
|
||||
|
||||
def _close(self):
|
||||
@ -314,7 +315,6 @@ class WalletNode:
|
||||
self.config["peer_connect_interval"],
|
||||
self.log,
|
||||
)
|
||||
asyncio.create_task(self.wallet_peers.start())
|
||||
|
||||
async def on_connect(self, peer: WSChiaConnection):
|
||||
if self.wallet_state_manager is None or self.backup_initialized is False:
|
||||
|
Loading…
Reference in New Issue
Block a user