Spaces:
Runtime error
Runtime error
Update blockchain.py
Browse files- blockchain.py +8 -8
blockchain.py
CHANGED
@@ -68,14 +68,14 @@ class Blockchain:
|
|
68 |
def new_transaction(self, block):
|
69 |
print (f'block::{block}')
|
70 |
trans_data = {
|
71 |
-
'name': block['transactions'][0]['sender'],
|
72 |
-
'index': block['index'],
|
73 |
-
'timestamp': block['timestamp'],
|
74 |
-
'recipient': block['transactions'][0]['recipient'],
|
75 |
-
'amount': block['transactions'][0]['amount'],
|
76 |
-
'balance': block['balance'],
|
77 |
-
'proof': block['proof'],
|
78 |
-
'previous_hash': block['previous_hash']
|
79 |
}
|
80 |
self.trans_data_out.append(trans_data)
|
81 |
self.pending_transactions.append(block)
|
|
|
68 |
def new_transaction(self, block):
|
69 |
print (f'block::{block}')
|
70 |
trans_data = {
|
71 |
+
'name': block[0]['transactions'][0]['sender'],
|
72 |
+
'index': block[0]['index'],
|
73 |
+
'timestamp': block[0]['timestamp'],
|
74 |
+
'recipient': block[0]['transactions'][0]['recipient'],
|
75 |
+
'amount': block[0]['transactions'][0]['amount'],
|
76 |
+
'balance': block[0]['balance'],
|
77 |
+
'proof': block[0]['proof'],
|
78 |
+
'previous_hash': block[0]['previous_hash']
|
79 |
}
|
80 |
self.trans_data_out.append(trans_data)
|
81 |
self.pending_transactions.append(block)
|