extract Preimages
fun LocalCommit.extractPreimages(tx: Transaction): Set<Pair<UpdateAddHtlc, ByteVector32>>
Content copied to clipboard
In CLOSING state, any time we see a new transaction, we try to extract a preimage from it in order to fulfill the corresponding incoming htlc in an upstream channel.
Not doing that would result in us losing money, because the downstream node would pull money from one side, and the upstream node would get refunded after a timeout.
Return
a set of pairs (add, preimage) if extraction was successful: - add is the htlc in the downstream channel from which we extracted the preimage - preimage needs to be sent to the upstream channel