Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ check-python:
@# W503: line break before binary operator
@flake8 --ignore=E501,E731,W503 --exclude=contrib/pylightning/lightning/__init__.py ${PYSRC}

PYTHONPATH=contrib/pylightning:$$PYTHONPATH $(PYTEST) contrib/pylightning/

check-includes:
@tools/check-includes.sh

Expand Down
8 changes: 5 additions & 3 deletions contrib/pylightning/lightning/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def __init__(self, socket_path, executor=None, logger=logging, encoder=json.JSON

# Do we require the compatibility mode?
self._compat = True
self.next_id = 0

def _writeobj(self, sock, obj):
s = json.dumps(obj, cls=self.encoder)
Expand Down Expand Up @@ -208,8 +209,9 @@ def call(self, method, payload=None):
self._writeobj(sock, {
"method": method,
"params": payload,
"id": 0
"id": self.next_id,
})
self.next_id += 1
resp, _ = self._readobj_compat(sock)
sock.close()

Expand Down Expand Up @@ -291,7 +293,7 @@ def listnodes(self, node_id=None):
}
return self.call("listnodes", payload)

def getroute(self, peer_id, msatoshi, riskfactor, cltv=9, fromid=None, fuzzpercent=None, seed=None, exclude=[]):
def getroute(self, node_id, msatoshi, riskfactor, cltv=9, fromid=None, fuzzpercent=None, seed=None, exclude=[]):
"""
Show route to {id} for {msatoshi}, using {riskfactor} and optional
{cltv} (default 9). If specified search from {fromid} otherwise use
Expand All @@ -300,7 +302,7 @@ def getroute(self, peer_id, msatoshi, riskfactor, cltv=9, fromid=None, fuzzperce
seed. {exclude} is an optional array of scid/direction to exclude.
"""
payload = {
"id": peer_id,
"id": node_id,
"msatoshi": msatoshi,
"riskfactor": riskfactor,
"cltv": cltv,
Expand Down
Loading