Skip to content

Commit 7ed84d8

Browse files
committed
fix(blockchain): broadcast block
1 parent 1291aad commit 7ed84d8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

blockchain.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ def create_block(self, nonce, previous_hash):
143143
# Reset the current list of transactions
144144
self.current_transactions = []
145145

146-
self.chain.append(block)
147-
print("I'm sending a block", block)
148-
self.network.broadcast_block(jsonpickle.encode(block))
146+
self.submit_block(block)
149147

150148
return block
151149

@@ -168,6 +166,12 @@ def submit_block(self, block):
168166

169167
self.chain.append(block)
170168

169+
# Idk If I have to do this, but... :)
170+
self.current_transactions = []
171+
172+
print("I'm sending a block", block)
173+
self.network.broadcast_block(jsonpickle.encode(block))
174+
171175
return True
172176

173177
def valid_chain(self, chain):

network_integration.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,3 @@
2727
bc.submit_transaction(transaction3)
2828

2929
print("Les transaction : ", bc.current_transactions)
30-
31-
time.sleep(15)
32-
33-
print("Les transaction : ", bc.current_transactions)

0 commit comments

Comments
 (0)