wallet/txauthor: rename relayFeePerKb to feeRatePerKb
The new name more accurately reflects the usage of the value. This is the target fee rate that the constructed transaction should aim to meet.
This commit is contained in:
parent
fbb3bc184d
commit
cde4b5dca4
1 changed files with 3 additions and 3 deletions
|
@ -83,12 +83,12 @@ type ChangeSource func() ([]byte, error)
|
|||
// InputSourceError is returned.
|
||||
//
|
||||
// BUGS: Fee estimation may be off when redeeming non-compressed P2PKH outputs.
|
||||
func NewUnsignedTransaction(outputs []*wire.TxOut, relayFeePerKb btcutil.Amount,
|
||||
func NewUnsignedTransaction(outputs []*wire.TxOut, feeRatePerKb btcutil.Amount,
|
||||
fetchInputs InputSource, fetchChange ChangeSource) (*AuthoredTx, error) {
|
||||
|
||||
targetAmount := SumOutputValues(outputs)
|
||||
estimatedSize := txsizes.EstimateVirtualSize(0, 1, 0, outputs, true)
|
||||
targetFee := txrules.FeeForSerializeSize(relayFeePerKb, estimatedSize)
|
||||
targetFee := txrules.FeeForSerializeSize(feeRatePerKb, estimatedSize)
|
||||
|
||||
for {
|
||||
inputAmount, inputs, inputValues, scripts, err := fetchInputs(targetAmount + targetFee)
|
||||
|
@ -117,7 +117,7 @@ func NewUnsignedTransaction(outputs []*wire.TxOut, relayFeePerKb btcutil.Amount,
|
|||
|
||||
maxSignedSize := txsizes.EstimateVirtualSize(p2pkh, p2wpkh,
|
||||
nested, outputs, true)
|
||||
maxRequiredFee := txrules.FeeForSerializeSize(relayFeePerKb, maxSignedSize)
|
||||
maxRequiredFee := txrules.FeeForSerializeSize(feeRatePerKb, maxSignedSize)
|
||||
remainingAmount := inputAmount - targetAmount
|
||||
if remainingAmount < maxRequiredFee {
|
||||
targetFee = maxRequiredFee
|
||||
|
|
Loading…
Reference in a new issue