Skip to content

Commit

Permalink
Fixed watchtxid
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomtibo committed Apr 16, 2020
1 parent d2881bb commit 7286128
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ For now, libcn is a client library only, so it can not be used to handle callbac

Command not working:
- helloworld
- watchtxid
- gettxnslist
- conf
- newblock
Expand Down
6 changes: 5 additions & 1 deletion autocomplete.bash
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ ots_stamp
ots_getfile
ln_getinvoice
ln_decodebolt11
ln_connectfund""" cn cnt cnm cn-cli
ln_connectfund
conf
newblock
executecallbacks
ots_backoffice""" cn cnt cnm cn-cli
2 changes: 1 addition & 1 deletion cn-cli
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def handle_cmdline_config(arg):
conf.add_argument('--key', nargs=1, type=str, default=['None'], help='Set the cyphernode autorisation key')
conf.add_argument('--url', nargs=1, type=str, default=['None'], help='Set the cyphernode URL')
# conf.add_argument('-h', '--help', help='Show this help message and exit')
conf.add_argument('-l', '--list', nargs=1, type=str, choices=['all', 'stats', 'watcher', 'spender'], help='List command available')
conf.add_argument('-l', '--list', nargs=1, type=str, choices=['all', 'stats', 'watcher', 'spender',' admin'], help='List command available')
conf.add_argument('-i', '--info', nargs=1, type=str, metavar='COMMAND', help='Get command informations')
# if configuration file exist, load it !
if os.path.exists("{}/.cn/cn.conf".format(os.path.expanduser('~'))):
Expand Down
2 changes: 1 addition & 1 deletion libcn/libcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def watchxpub(self, xpub, label=None, path="0/n", nstart=0, cburl0=None, cburl1=
payload = json.dumps(payload)
response = self.post_data(call, endpoint, payload)
return response
def watchtxid(self, txid, cburl1=None, xcburl=None, xconf=6):############
def watchtxid(self, txid, cburl1=None, xcburl=None, xconf=6):
"txid [cburl xcburl xconf]"
call = 'watchtxid'
endpoint = "{}/{}".format(self.url, call)
Expand Down
6 changes: 4 additions & 2 deletions server_exemple.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ def conf(self, call):
print('Confirmation of adresse \'{}\' received {} at {} and the transaction fees is {}'.format(call['address'], amount, call['received'], fees))

def txunconf(self, call):
"Do stuff with unconfirmed transation callbacks"
"""Do stuff with unconfirmed transation callbacks
fields = ['id', 'txid', 'confirmations']"""

print('Transaction non confirmé = {}'.format(call))

def txconf(self, call):
"Do stuff with confirmed transaction callbacks"
"""Do stuff with confirmed transaction callbacks"
fields = ['id', 'txid', 'confirmations']"""

print('Transaction confirmé = {}'.format(call))

Expand Down

0 comments on commit 7286128

Please sign in to comment.