mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
onchaind: fulfill HTLCs onchain.
When we see an offered HTLC onchain, we need to use the preimage if we know it. So we dump all the known HTLC preimages at startup, and send new ones as we discover them. This doesn't cover preimages we know because we're the final recipient; that can happen if an HTLC hasn't been irrevocably committed yet. We'll do that in a followup patch. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -243,6 +243,7 @@ class LightningNode(object):
|
||||
self.daemon = daemon
|
||||
self.bitcoin = btc
|
||||
self.executor = executor
|
||||
self.known_fail = False
|
||||
|
||||
# Use batch if you're doing more than one async.
|
||||
def connect(self, remote_node, capacity, async=False):
|
||||
@@ -307,3 +308,9 @@ class LightningNode(object):
|
||||
c.close()
|
||||
db.close()
|
||||
return result
|
||||
|
||||
def has_failed(self):
|
||||
"""Note that a daemon has (deliberately) crashed, so we don't fail
|
||||
on cleanup"""
|
||||
self.known_fail = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user