mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
lightningd/invoice.c: Add timeout parameter to waitanyinvoice.
Fixes: #3192 Changelog-Added: `waitanyinvoice` now supports a `timeout` parameter, which when set will cause the command to fail when the timeout is reached; can set this to 0 to fail immediately if no new invoice has been paid yet.
This commit is contained in:
committed by
Christian Decker
parent
e379528254
commit
67590fc6be
@@ -988,14 +988,18 @@ class LightningRpc(UnixDomainSocketRpc):
|
||||
"""
|
||||
return self.call("stop")
|
||||
|
||||
def waitanyinvoice(self, lastpay_index=None):
|
||||
def waitanyinvoice(self, lastpay_index=None, timeout=None, **kwargs):
|
||||
"""
|
||||
Wait for the next invoice to be paid, after {lastpay_index}
|
||||
(if supplied)
|
||||
Fail after {timeout} seconds has passed without an invoice
|
||||
being paid.
|
||||
"""
|
||||
payload = {
|
||||
"lastpay_index": lastpay_index
|
||||
"lastpay_index": lastpay_index,
|
||||
"timeout": timeout
|
||||
}
|
||||
payload.update({k: v for k, v in kwargs.items()})
|
||||
return self.call("waitanyinvoice", payload)
|
||||
|
||||
def waitblockheight(self, blockheight, timeout=None):
|
||||
|
||||
Reference in New Issue
Block a user