input+sweep: let weightestimator take known TxOut

This commit is contained in:
Johan T. Halseth committed 2020-11-20 13:06:53 +01:00
1 parent efd6bc9501
commit 3d209059c1
3 files changed
+47

No files matched your search

+7
View File
@@ -2,6 +2,7 @@ package sweep
import (
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
@@ -92,6 +93,12 @@ func (w *weightEstimator) addP2WKHOutput() {
w.estimator.AddP2WKHOutput()
}
// addOutput updates the weight estimate to account for the known
// output given.
func (w *weightEstimator) addOutput(txOut *wire.TxOut) {
w.estimator.AddTxOutput(txOut)
}
// weight gets the estimated weight of the transaction.
func (w *weightEstimator) weight() int {
return w.estimator.Weight()