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:
parent
7b675446f0
commit
4e6c816d11
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user