lightningd: addgossip API to inject gossip messages.

Importantly, this is synchronous, so pay will be able to use it
reliably.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-02-02 15:46:20 +10:30
committed by Christian Decker
parent f1c599516e
commit 3c5502426b
8 changed files with 261 additions and 26 deletions

View File

@@ -484,6 +484,15 @@ class LightningRpc(UnixDomainSocketRpc):
if patch_json:
monkey_patch_json(patch=True)
def addgossip(self, message):
"""
Inject this (hex-encoded) gossip message.
"""
payload = {
"message": message,
}
return self.call("addgossip", payload)
def autocleaninvoice(self, cycle_seconds=None, expired_by=None):
"""
Sets up automatic cleaning of expired invoices. {cycle_seconds} sets