diff --git a/main.py b/main.py index dd51fd5..c3dc943 100644 --- a/main.py +++ b/main.py @@ -330,6 +330,11 @@ async def on_peer_connected(writer): await network.start(port=port, host=host) + # Fund this node's wallet so it can transact in the demo + if fund > 0: + chain.state.credit_mining_reward(pk, reward=fund) + logger.info("💰 Funded %s... with %d coins", pk[:12], fund) + # Connect to a seed peer if requested if connect_to: try: @@ -338,11 +343,6 @@ async def on_peer_connected(writer): except ValueError: logger.error("Invalid --connect format. Use host:port") - # Fund this node's wallet so it can transact in the demo - if fund > 0: - chain.state.credit_mining_reward(pk, reward=fund) - logger.info("💰 Funded %s... with %d coins", pk[:12], fund) - try: await cli_loop(sk, pk, chain, mempool, network) finally: