mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-17 22:24:21 +01:00
lnwallet: properly handle HTLC settles in channel state-machine
We no longer track HTLC’s by their r-hash within the log into the index, as we may have multiple HTLC’s that can be redeemed by the same pre-image. Instead we now use a separate index which is keyed by a log-index. Additionally, the SettleHTLC method now also returns the index of the HTLC being settled which allows the remote party to quickly locate the HTLC within their log. This commit also introduces a few trace/debug log messages which will likely be pruned in the near future
This commit is contained in:
@@ -348,7 +348,8 @@ func senderHtlcSpendTimeout(commitScript []byte, outputAmt btcutil.Amount,
|
||||
// OP_ENDIF
|
||||
// <sender key> OP_CHECKSIG
|
||||
// OP_ENDIF
|
||||
// TODO(roasbeef): rename these to sender vs receiver?
|
||||
// TODO(roasbeef): go back to revocation keys in the HTLC outputs?
|
||||
// * also could combine pre-image with their key?
|
||||
func receiverHTLCScript(absoluteTimeout, relativeTimeout uint32, senderKey,
|
||||
receiverKey *btcec.PublicKey, revokeHash, paymentHash []byte) ([]byte, error) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user