Skip to content

Commit 08533b5

Browse files
committed
fix(main): set block miner before chain admission to prevent state mismatch
1 parent 00ed340 commit 08533b5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def mine_and_process_block(chain, mempool, miner_pk):
8181
index=chain.last_block.index + 1,
8282
previous_hash=chain.last_block.hash,
8383
transactions=mineable_txs,
84+
miner=miner_pk,
8485
)
8586

8687
mined_block = mine_block(block)
@@ -238,7 +239,6 @@ async def cli_loop(sk, pk, chain, mempool, network):
238239
elif cmd == "mine":
239240
mined = mine_and_process_block(chain, mempool, pk)
240241
if mined:
241-
mined.miner = pk
242242
await network.broadcast_block(mined)
243243

244244
# ── peers ──

0 commit comments

Comments
 (0)