mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
lnwallet: fix ordering of keys when we generate the sender script during a breach
In this commit, we fix an existing within lnd. Before this commit, within NewBreachRetribution the order of the keys when generating the sender HTLC script was incorrect. As in this case, the remote party is the sender, their key should be first. However, the order was swapped, meaning that at breach time, our transaction would be rejected as it had the incorrect witness script. The fix is simple: swap the ordering of the keys. After this commit, the test extension added in the prior commit now passes.
This commit is contained in:
parent
e91dff44e6
commit
4e44528bff
@ -1992,7 +1992,7 @@ func NewBreachRetribution(chanState *channeldb.OpenChannel, stateNum uint64,
|
||||
// re-generate the sender HTLC script.
|
||||
if htlc.Incoming {
|
||||
htlcScript, err = senderHTLCScript(
|
||||
keyRing.LocalHtlcKey, keyRing.RemoteHtlcKey,
|
||||
keyRing.RemoteHtlcKey, keyRing.LocalHtlcKey,
|
||||
keyRing.RevocationKey, htlc.RHash[:],
|
||||
)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user