lightningd/peer_control.c: Implement waitblockheight.

This is needed to fully implement handling of blockheight disagreements
between us and payee.
If payee believes the blockheight is higher than ours, then `pay`
should wait for our node to achieve that blockheight.

Changelog-Add: Implement `waitblockheight` to wait for a specific blockheight.
This commit is contained in:
ZmnSCPxj
2019-12-26 10:19:09 +00:00
committed by Christian Decker
parent 44e8256338
commit 54cc735201
11 changed files with 244 additions and 2 deletions

View File

@@ -997,6 +997,16 @@ class LightningRpc(UnixDomainSocketRpc):
}
return self.call("waitanyinvoice", payload)
def waitblockheight(self, blockheight, timeout=None):
"""
Wait for the blockchain to reach the specified block height.
"""
payload = {
"blockheight": blockheight,
"timeout": timeout
}
return self.call("waitblockheight", payload)
def waitinvoice(self, label):
"""
Wait for an incoming payment matching the invoice with {label}