breacharbiter: correct weight estimation for inputs in justice tx

Before this commit, we had the weight estimates flipped. When sweeping
w/o any delay, we’re spending a regular P2WKH output. When we’re
sweeping their CSV delayed output, we’ll using the entire to-local
script, so we need to properly account for that.
This commit is contained in:
Olaoluwa Osuntokun 2018-01-22 17:05:09 -08:00
parent 7b675446f0
commit 4e6c816d11
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -906,10 +906,10 @@ func (b *breachArbiter) createJusticeTx(
var witnessWeight int
switch input.WitnessType() {
case lnwallet.CommitmentNoDelay:
witnessWeight = lnwallet.ToLocalPenaltyWitnessSize
witnessWeight = lnwallet.P2WKHWitnessSize
case lnwallet.CommitmentRevoke:
witnessWeight = lnwallet.P2WKHWitnessSize
witnessWeight = lnwallet.ToLocalPenaltyWitnessSize
case lnwallet.HtlcOfferedRevoke:
witnessWeight = lnwallet.OfferedHtlcPenaltyWitnessSize