From 4e6c816d114f9e5d4f366792a4fb58bcbaa73900 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 22 Jan 2018 17:05:09 -0800 Subject: [PATCH] breacharbiter: correct weight estimation for inputs in justice tx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- breacharbiter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/breacharbiter.go b/breacharbiter.go index 2d89a300..70eedea2 100644 --- a/breacharbiter.go +++ b/breacharbiter.go @@ -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