mirror of https://github.com/BTCPrivate/lnd.git
lnwallet: add VSize method for returning size from TxWeightEstimator
This commit is contained in:
parent
f6ac5658e2
commit
088d9bc42f
|
@ -513,3 +513,9 @@ func (twe *TxWeightEstimator) Weight() int {
|
||||||
}
|
}
|
||||||
return weight
|
return weight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// VSize gets the estimated virtual size of the transactions, in vbytes.
|
||||||
|
func (twe *TxWeightEstimator) VSize() int {
|
||||||
|
// A tx's vsize is 1/4 of the weight, rounded up.
|
||||||
|
return (twe.Weight() + witnessScaleFactor - 1) / witnessScaleFactor
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue