diff --git a/lnwallet/size.go b/lnwallet/size.go index d633c390..d6821eac 100644 --- a/lnwallet/size.go +++ b/lnwallet/size.go @@ -513,3 +513,9 @@ func (twe *TxWeightEstimator) Weight() int { } 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 +}