Skip to content

Commit fc2e36e

Browse files
committed
more erroo check in lightning payment
1 parent 4301a54 commit fc2e36e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

safebox/wallet.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,11 +1329,19 @@ def pay_multi( self,
13291329
response = requests.post(url=melt_url,json=data_to_send,headers=headers)
13301330
print(response.json())
13311331
payment_json = response.json()
1332-
if payment_json['paid']:
1333-
print("paid ok")
1332+
#TODO Need to do some error checking
13341333
print("need to do some error checking")
13351334
# {'detail': 'Lightning payment unsuccessful. no_route', 'code': 20000}
13361335
# add keep proofs back into selected keyset proofs
1336+
if payment_json.get("paid",False):
1337+
print("lightning paid ok")
1338+
else:
1339+
print("payment did not go through")
1340+
# Add back in spend proofs
1341+
for each in spend_proofs:
1342+
proofs_from_keyset.append(each)
1343+
1344+
13371345
for each in keep_proofs:
13381346
proofs_from_keyset.append(each)
13391347
# print("self proofs", self.proofs)
@@ -1819,7 +1827,7 @@ def swap_multi_each(self):
18191827
# return
18201828
# All the proofs are verified, we are good to go for the swap
18211829
# In multi_each we are going to swap for each proof
1822-
#FIXME do a fix on the events here
1830+
18231831

18241832
for each_keyset in keyset_proofs:
18251833

0 commit comments

Comments
 (0)