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:
1 file changed
+2
-2
+2
-2
@@ -906,10 +906,10 @@ func (b *breachArbiter) createJusticeTx(
|
|||||||
var witnessWeight int
|
var witnessWeight int
|
||||||
switch input.WitnessType() {
|
switch input.WitnessType() {
|
||||||
case lnwallet.CommitmentNoDelay:
|
case lnwallet.CommitmentNoDelay:
|
||||||
witnessWeight = lnwallet.ToLocalPenaltyWitnessSize
|
witnessWeight = lnwallet.P2WKHWitnessSize
|
||||||
|
|
||||||
case lnwallet.CommitmentRevoke:
|
case lnwallet.CommitmentRevoke:
|
||||||
witnessWeight = lnwallet.P2WKHWitnessSize
|
witnessWeight = lnwallet.ToLocalPenaltyWitnessSize
|
||||||
|
|
||||||
case lnwallet.HtlcOfferedRevoke:
|
case lnwallet.HtlcOfferedRevoke:
|
||||||
witnessWeight = lnwallet.OfferedHtlcPenaltyWitnessSize
|
witnessWeight = lnwallet.OfferedHtlcPenaltyWitnessSize
|
||||||
|
|||||||
Reference in new issue
Block a user