input+sweep: let weightestimator take known TxOut

This commit is contained in:
Johan T. Halseth
2020-11-06 19:41:56 +01:00
parent efd6bc9501
commit 3d209059c1
3 changed files with 47 additions and 0 deletions

View File

@@ -533,6 +533,14 @@ func (twe *TxWeightEstimator) AddNestedP2WSHInput(witnessSize int) *TxWeightEsti
return twe
}
// AddTxOutput adds a known TxOut to the weight estimator.
func (twe *TxWeightEstimator) AddTxOutput(txOut *wire.TxOut) *TxWeightEstimator {
twe.outputSize += txOut.SerializeSize()
twe.outputCount++
return twe
}
// AddP2PKHOutput updates the weight estimate to account for an additional P2PKH
// output.
func (twe *TxWeightEstimator) AddP2PKHOutput() *TxWeightEstimator {