mirror of
https://github.com/curly60e/pyblock.git
synced 2026-08-19 13:18:13 +02:00
Refactored by Sourcery
This commit is contained in:
parent
778cc25956
commit
9dc6466790
1 changed files with 16 additions and 19 deletions
|
|
@ -121,14 +121,14 @@ def locallistchaintxns():
|
|||
print("\t\nTransactions\n")
|
||||
try:
|
||||
print("\n\tLIST ONCHAIN TRANSACTIONS\n")
|
||||
for r in range(len(n)):
|
||||
s = n[r]
|
||||
for item_ in n:
|
||||
s = item_
|
||||
|
||||
print("Transaction Hash: " + s['tx_hash'])
|
||||
nd = input("\nSelect RHash: ")
|
||||
|
||||
for r in range(len(n)):
|
||||
s = n[r]
|
||||
for item in n:
|
||||
s = item
|
||||
nn = s['tx_hash']
|
||||
trx = s['dest_addresses']
|
||||
if nd == nn:
|
||||
|
|
@ -174,15 +174,15 @@ def locallistinvoices():
|
|||
print("\tInvoices\n")
|
||||
try:
|
||||
print("\n\tLIST INVOICES\n")
|
||||
for r in range(len(n)):
|
||||
s = n[r]
|
||||
for item_ in n:
|
||||
s = item_
|
||||
|
||||
print("Invoice: " + s['r_hash'] + " " + s['state'])
|
||||
|
||||
nd = input("\nSelect RHash: ")
|
||||
|
||||
for r in range(len(n)):
|
||||
s = n[r]
|
||||
for item in n:
|
||||
s = item
|
||||
nn = s['r_hash']
|
||||
if nd == nn:
|
||||
print("\n----------------------------------------------------------------------------------------------------------------")
|
||||
|
|
@ -218,13 +218,13 @@ def locallistchannels():
|
|||
print("\t\nChannels\n")
|
||||
try:
|
||||
print("\n\tLIST CHANNELS\n")
|
||||
for r in range(len(n)):
|
||||
s = n[r]
|
||||
for item_ in n:
|
||||
s = item_
|
||||
print("Node ID: " + s['remote_pubkey'])
|
||||
|
||||
nd = input("\nSelect a Node ID: ")
|
||||
for r in range(len(n)):
|
||||
s = n[r]
|
||||
for item in n:
|
||||
s = item
|
||||
nn = s['remote_pubkey']
|
||||
if nd == nn:
|
||||
print("\n----------------------------------------------------------------------------------------------------------------")
|
||||
|
|
@ -330,10 +330,9 @@ def localpayinvoice():
|
|||
amt = " --amt "
|
||||
amount = input("Amount in satoshis: ")
|
||||
os.system(lndconnectload['ln'] + lncli + invoice + amt + amount)
|
||||
t.sleep(2)
|
||||
else:
|
||||
os.system(lndconnectload['ln'] + lncli + invoice )
|
||||
t.sleep(2)
|
||||
t.sleep(2)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
|
@ -364,7 +363,7 @@ def localkeysend():
|
|||
node = input("Send to NodeID: ")
|
||||
amount = input("Amount in sats: ")
|
||||
while True:
|
||||
if amount == "" or amount == "0":
|
||||
if amount in ["", "0"]:
|
||||
amount = input("\nAmount in sats: ")
|
||||
else:
|
||||
break
|
||||
|
|
@ -524,16 +523,14 @@ def payinvoice():
|
|||
clear()
|
||||
blogo()
|
||||
tick()
|
||||
print("\033[0;37;40m")
|
||||
t.sleep(2)
|
||||
else:
|
||||
error_message = r.json()["error"]
|
||||
print("\033[1;31;40m")
|
||||
clear()
|
||||
blogo()
|
||||
canceled()
|
||||
print("\033[0;37;40m")
|
||||
t.sleep(2)
|
||||
print("\033[0;37;40m")
|
||||
t.sleep(2)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue