peer: update cooperative closure unit tests to latest negotiation policy

With the new negotiation policy, we instead just need to ensure that
our fee inches closer to the other party’s with each iteration, and
that it’s within the proper bounds.
This commit is contained in:
Olaoluwa Osuntokun committed 2017-11-23 23:10:15 -06:00
1 parent 385023f0b7
commit 1d65839bca
3 files changed
+189 -89

No files matched your search

+7 -2
View File
@@ -1132,8 +1132,13 @@ func (b *breachArbiter) sweepSpendableOutputsTxn(txWeight uint64,
totalAmt += input.Amount()
}
feePerWeight := b.cfg.Estimator.EstimateFeePerWeight(1)
txFee := btcutil.Amount(txWeight * feePerWeight)
// We'll actually attempt to target inclusion within the next two
// blocks as we'd like to sweep these funds back into our wallet ASAP.
feePerWeight, err := b.cfg.Estimator.EstimateFeePerWeight(2)
if err != nil {
return nil, err
}
txFee := btcutil.Amount(txWeight * uint64(feePerWeight))
sweepAmt := int64(totalAmt - txFee)