lnwallet+breacharbiter: update breach logic to be aware of new commitment format
In this commit, we update the brar logic in the channel state machine, and also the brar itself to be aware of the new commitment format. Similar to the unilateral close summary, we'll now blank out the SingleTweak field in `NewBreachRetribution` if it's a tweakless commitment. The brar will then use this to properly identify the commitment type, to ensure we use the proper witness generation function when we're handling our own breach.
This commit is contained in:
3 files changed
+59
-6
No files matched your search
@@ -2066,6 +2066,12 @@ func NewBreachRetribution(chanState *channeldb.OpenChannel, stateNum uint64,
|
||||
},
|
||||
HashType: txscript.SigHashAll,
|
||||
}
|
||||
|
||||
// If this is a tweakless commitment, then we can safely blank
|
||||
// out the SingleTweak value as it isn't needed.
|
||||
if tweaklessCommit {
|
||||
localSignDesc.SingleTweak = nil
|
||||
}
|
||||
}
|
||||
|
||||
// Similarly, if the remote balance exceeds the remote party's dust
|
||||
|
||||
Reference in new issue
Block a user