protocol: split message update_remove_htlc into update_timedout_htlc and update_routefail_htlc, remove update_remove_htlc_delay.

For the moment, there's no way to remove an in-progress HTLC before
it's timed out.  The other side can remove it with a routefail, but
you can't push for it to be removed.

We may add that later, but by definition it's only a polited request, and
normally we should rely on timeouts.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2015-09-24 15:02:49 +09:30
parent 807ac38308
commit d00eeded9f
7 changed files with 252 additions and 173 deletions

16
pkt.h
View File

@@ -105,7 +105,7 @@ struct pkt *update_htlc_add_pkt(const tal_t *ctx,
u32 abs_locktime_seconds);
/**
* update_htlc_complete_pkt - create an update message removing a HTLC
* update_htlc_complete_pkt - create an update message completing a HTLC
* @ctx: tal context to allocate off.
* @revocation_hash: the revocation hash for the next commitment tx.
* @rval: the r value for the HTLC
@@ -115,15 +115,25 @@ struct pkt *update_htlc_complete_pkt(const tal_t *ctx,
const struct sha256 *rval);
/**
* update_htlc_remove_pkt - create an update message completing a HTLC
* update_htlc_timedout_pkt - create an update message removing a HTLC
* @ctx: tal context to allocate off.
* @revocation_hash: the revocation hash for the next commitment tx.
* @htlc_rhash: the hash of the htlc secret.
*/
struct pkt *update_htlc_remove_pkt(const tal_t *ctx,
struct pkt *update_htlc_timedout_pkt(const tal_t *ctx,
const struct sha256 *revocation_hash,
const struct sha256 *htlc_rhash);
/**
* update_htlc_routefail_pkt - create an update message removing a HTLC
* @ctx: tal context to allocate off.
* @revocation_hash: the revocation hash for the next commitment tx.
* @htlc_rhash: the hash of the htlc secret.
*/
struct pkt *update_htlc_routefail_pkt(const tal_t *ctx,
const struct sha256 *revocation_hash,
const struct sha256 *htlc_rhash);
/**
* update_accept_pkt - create an update_accept message
* @ctx: tal context to allocate off.