mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
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>
These are standard bitcoin manipulation routines which should be provided by any normal bitcoin library in whatever language you choose. The ones here are standalone ones taken from bitcoin core and some I wrote, many taken from bitcoin-iterate and pasted in here.