another cln rpc sse try

This commit is contained in:
benarc 2021-11-03 16:14:47 +00:00
parent a486cbe278
commit 92ea0635d7

View File

@ -122,11 +122,12 @@ class CLightningWallet(Wallet):
call = json.dumps(
{"method": "waitanyinvoice", "id": 0, "params": [self.last_pay_index]}
)
writer.write(call.encode("utf-8"))
writer.write(call.encode())
await writer.drain()
data = await reader.read(100)
data = await reader.read(500)
paid = json.loads(data.decode("ascii"))
print(paid)
paid = self.ln.waitanyinvoice(self.last_pay_index)
self.last_pay_index = paid["pay_index"]