Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -357,17 +357,17 @@ def issue_tokens(send,rec,amount):
|
|
357 |
pass
|
358 |
if p==True:
|
359 |
try:
|
360 |
-
if lod["chain"][-1]["index"] > 1:
|
361 |
-
|
362 |
-
if lod["chain"][-1]["index"] == 1:
|
363 |
-
|
364 |
except Exception:
|
365 |
p=False
|
366 |
try:
|
367 |
-
if lod["chain"][0]["index"] > 1:
|
368 |
-
|
369 |
-
if lod["chain"][0]["index"] == 1:
|
370 |
-
|
371 |
p=True
|
372 |
except Exception:
|
373 |
p=False
|
@@ -411,14 +411,14 @@ def issue_tokens(send,rec,amount):
|
|
411 |
if p==True:
|
412 |
mychain_send.new_transaction(f"{send}",f"{rec}",f"{amount}",f"{balance_send}")
|
413 |
message_send = "Transaction Added to Pool"
|
414 |
-
|
415 |
mychain_rec.new_transaction(f"{send}",f"{rec}",f"{amount}",f"{balance_rec}")
|
416 |
message_rec = "Transaction Added to Pool"
|
417 |
-
|
418 |
response_send, show_chain_send, message_send = mychain_mine_block_send(balance_send, chain_r=None,chain_n=send)
|
419 |
response_rec, show_chain_rec, message_rec = mychain_mine_block_rec(balance_rec, chain_r=None,chain_n=rec)
|
420 |
mes = (f'Send: {message_send} :: Recieve: {message_rec}')
|
421 |
-
return (mes, p, response_send, response_rec, show_chain_send, show_chain_rec,
|
422 |
#return (mes, p, response_send)
|
423 |
############################## MYCHAIN END ###############################
|
424 |
|
|
|
357 |
pass
|
358 |
if p==True:
|
359 |
try:
|
360 |
+
#if lod["chain"][-1]["index"] > 1:
|
361 |
+
balance = lod[-1]["balance"]
|
362 |
+
#if lod["chain"][-1]["index"] == 1:
|
363 |
+
# balance = 0
|
364 |
except Exception:
|
365 |
p=False
|
366 |
try:
|
367 |
+
#if lod["chain"][0]["index"] > 1:
|
368 |
+
balance = lod[0]["balance"]
|
369 |
+
#if lod["chain"][0]["index"] == 1:
|
370 |
+
# balance = 0
|
371 |
p=True
|
372 |
except Exception:
|
373 |
p=False
|
|
|
411 |
if p==True:
|
412 |
mychain_send.new_transaction(f"{send}",f"{rec}",f"{amount}",f"{balance_send}")
|
413 |
message_send = "Transaction Added to Pool"
|
414 |
+
data_send = pd.DataFrame(mychain_send.pending_transactions)
|
415 |
mychain_rec.new_transaction(f"{send}",f"{rec}",f"{amount}",f"{balance_rec}")
|
416 |
message_rec = "Transaction Added to Pool"
|
417 |
+
data_rec = pd.DataFrame(mychain_rec.pending_transactions)
|
418 |
response_send, show_chain_send, message_send = mychain_mine_block_send(balance_send, chain_r=None,chain_n=send)
|
419 |
response_rec, show_chain_rec, message_rec = mychain_mine_block_rec(balance_rec, chain_r=None,chain_n=rec)
|
420 |
mes = (f'Send: {message_send} :: Recieve: {message_rec}')
|
421 |
+
return (mes, p, response_send, response_rec, show_chain_send, show_chain_rec, data_send, data_rec, message_send, message_rec)
|
422 |
#return (mes, p, response_send)
|
423 |
############################## MYCHAIN END ###############################
|
424 |
|