mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
pylightning: Don't always use request ID 0
This isn't a problem for now since we don't support multithreading, and only allow synchronous calls, but eventually this'll become important. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
f452d00b77
commit
9670b4382f
@ -130,6 +130,7 @@ class UnixDomainSocketRpc(object):
|
||||
|
||||
# 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)
|
||||
@ -208,8 +209,9 @@ class UnixDomainSocketRpc(object):
|
||||
self._writeobj(sock, {
|
||||
"method": method,
|
||||
"params": payload,
|
||||
"id": 0
|
||||
"id": self.next_id,
|
||||
})
|
||||
self.next_id += 1
|
||||
resp, _ = self._readobj_compat(sock)
|
||||
sock.close()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user