BOLT update to fae35903ae600d61124a3920363094b02d2ae8e5

This details handling of onchain HTLCs, and we document how we
implement it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-09-27 06:32:47 +09:30
parent 1ac9e0b532
commit 4ce9f73e00
2 changed files with 28 additions and 21 deletions

View File

@@ -1115,6 +1115,19 @@ static void onchaind_tell_fulfill(struct peer *peer)
if (hin->key.peer != peer)
continue;
/* BOLT #5:
*
* If the node receives (or already knows) a payment preimage
* for an unresolved HTLC output it was offered for which it
* has committed to an outgoing HTLC, it MUST *resolve* the
* output by spending it. Otherwise, if the other node is not
* irrevocably committed to the HTLC, it MUST NOT *resolve*
* the output by spending it.
*/
/* We only set preimage once it's irrevocably committed, and
* we spend even if we don't have an outgoing HTLC (eg. local
* payyment complete) */
if (!hin->preimage)
continue;