Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -271,13 +271,29 @@ def mychain_mine_block_send(balance, chain_r=None,chain_n=None):
|
|
271 |
'previous_hash': block['previous_hash']
|
272 |
}
|
273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
message = "A block is MINED"
|
275 |
show_chain = display_chain_send()
|
|
|
276 |
if len(mychain_send.chain) > 1000:
|
277 |
mychain_send.reset()
|
278 |
response = None
|
279 |
show_chain=display_chain_send()
|
280 |
message = "New Chain Created at Max 20 Blocks"
|
|
|
281 |
return response, show_chain,message
|
282 |
|
283 |
def mychain_mine_block_rec(balance, chain_r=None,chain_n=None):
|
|
|
271 |
'previous_hash': block['previous_hash']
|
272 |
}
|
273 |
|
274 |
+
previous_post = mychain_sned.print_previous_block()
|
275 |
+
|
276 |
+
block = {'index': previous_post['index'],
|
277 |
+
'timestamp': previous_post['timestamp'],
|
278 |
+
'sender': previous_post['transactions']['sender'],
|
279 |
+
'recipient': previous_post['transactions']['recipient'],
|
280 |
+
'amount': previous_post['transactions']['amount'],
|
281 |
+
'balance': previous_post['balance'],
|
282 |
+
'proof': previous_post['index'],
|
283 |
+
'previous_hash': previous_post['index']}
|
284 |
+
bc_transactions(block)
|
285 |
+
|
286 |
+
|
287 |
+
|
288 |
message = "A block is MINED"
|
289 |
show_chain = display_chain_send()
|
290 |
+
|
291 |
if len(mychain_send.chain) > 1000:
|
292 |
mychain_send.reset()
|
293 |
response = None
|
294 |
show_chain=display_chain_send()
|
295 |
message = "New Chain Created at Max 20 Blocks"
|
296 |
+
|
297 |
return response, show_chain,message
|
298 |
|
299 |
def mychain_mine_block_rec(balance, chain_r=None,chain_n=None):
|