mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
daemon/output_to_htlc: routines to map outputs for HTLCs for a given commit_num.
And use this to resolve old transactions by comparing outputs with HTLCs. Rather than remembering the output ordering for every one of their previous commitment transactions, we just remember the commitment number for each commitment txid, and when we see it, derive all the HTLC scriptpubkeys and the to-us and to-them scriptpubkeys, and figure out which is which. This avoids us having to save information on disk, except for the txid->commitment-number mapping (and the shachain). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -112,6 +112,9 @@ u8 **bitcoin_witness_htlc(const tal_t *ctx,
|
||||
/* Is this a pay to script hash? */
|
||||
bool is_p2sh(const u8 *script, size_t script_len);
|
||||
|
||||
/* Is this (version 0) pay to witness script hash? */
|
||||
bool is_p2wsh(const u8 *script, size_t script_len);
|
||||
|
||||
/* Are these two scripts equal? */
|
||||
bool scripteq(const u8 *s1, size_t s1len, const u8 *s2, size_t s2len);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user