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 committed 2018-01-22 19:20:01 -08:00
1 parent 7b675446f0
commit 4e6c816d11
1 file changed
+2 -2
+2 -2
View File
@@ -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