mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +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:
@@ -195,6 +195,8 @@ struct peer {
|
||||
struct {
|
||||
/* Everything (watches, resolved[], etc) tal'ed off this */
|
||||
const struct bitcoin_tx *tx;
|
||||
/* Set for STATE_CLOSE_ONCHAIN_THEIR_UNILATERAL
|
||||
* and STATE_CLOSE_ONCHAIN_OUR_UNILATERAL */
|
||||
const struct commit_info *ci;
|
||||
const struct bitcoin_tx **resolved;
|
||||
} closing_onchain;
|
||||
|
||||
Reference in New Issue
Block a user