Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -126,19 +126,16 @@ def add_transaction(id, kind, data):
|
|
126 |
blockchain.new_transaction(id, kind, data)
|
127 |
|
128 |
if len(blockchain.current_transactions)>=5:
|
129 |
-
|
|
|
|
|
|
|
130 |
new_block = blockchain.new_block()
|
131 |
|
132 |
return "ok"
|
133 |
else:
|
134 |
return "fail"
|
135 |
|
136 |
-
def proof(model_name):
|
137 |
-
peers = get_peers(model_name)
|
138 |
-
for id in blockchain.user_gpus:
|
139 |
-
if not get_p(id) in peers:
|
140 |
-
add_transaction(id, "out", 0)
|
141 |
-
|
142 |
|
143 |
def get_coin(id):
|
144 |
c = blockchain.get_user_balance(id)
|
|
|
126 |
blockchain.new_transaction(id, kind, data)
|
127 |
|
128 |
if len(blockchain.current_transactions)>=5:
|
129 |
+
peers = get_peers(model_name)
|
130 |
+
for id in blockchain.user_gpus:
|
131 |
+
if not get_p(id) in peers:
|
132 |
+
blockchain.new_transaction(id, "out", 0)
|
133 |
new_block = blockchain.new_block()
|
134 |
|
135 |
return "ok"
|
136 |
else:
|
137 |
return "fail"
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
def get_coin(id):
|
141 |
c = blockchain.get_user_balance(id)
|