mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-13 18:31:51 +02:00
lnwallet: make SendOutputs take feerate in SatPerVByte
This commit is contained in:
parent
68557e43c1
commit
f6ac5658e2
@ -316,11 +316,11 @@ func (b *BtcWallet) FetchRootKey() (*btcec.PrivateKey, error) {
|
|||||||
//
|
//
|
||||||
// This is a part of the WalletController interface.
|
// This is a part of the WalletController interface.
|
||||||
func (b *BtcWallet) SendOutputs(outputs []*wire.TxOut,
|
func (b *BtcWallet) SendOutputs(outputs []*wire.TxOut,
|
||||||
feeSatPerByte btcutil.Amount) (*chainhash.Hash, error) {
|
feeRate lnwallet.SatPerVByte) (*chainhash.Hash, error) {
|
||||||
|
|
||||||
// The fee rate is passed in using units of sat/byte, so we'll scale
|
// The fee rate is passed in using units of sat/vbyte, so we'll scale
|
||||||
// this up to sat/KB as the SendOutputs method requires this unit.
|
// this up to sat/KB as the SendOutputs method requires this unit.
|
||||||
feeSatPerKB := feeSatPerByte * 1024
|
feeSatPerKB := btcutil.Amount(feeRate * 1000)
|
||||||
|
|
||||||
return b.wallet.SendOutputs(outputs, defaultAccount, 1, feeSatPerKB)
|
return b.wallet.SendOutputs(outputs, defaultAccount, 1, feeSatPerKB)
|
||||||
}
|
}
|
||||||
|
@ -161,9 +161,9 @@ type WalletController interface {
|
|||||||
// paying out to the specified outputs. In the case the wallet has
|
// paying out to the specified outputs. In the case the wallet has
|
||||||
// insufficient funds, or the outputs are non-standard, an error should
|
// insufficient funds, or the outputs are non-standard, an error should
|
||||||
// be returned. This method also takes the target fee expressed in
|
// be returned. This method also takes the target fee expressed in
|
||||||
// sat/byte that should be used when crafting the transaction.
|
// sat/vbyte that should be used when crafting the transaction.
|
||||||
SendOutputs(outputs []*wire.TxOut,
|
SendOutputs(outputs []*wire.TxOut,
|
||||||
feeSatPerByte btcutil.Amount) (*chainhash.Hash, error)
|
feeRate SatPerVByte) (*chainhash.Hash, error)
|
||||||
|
|
||||||
// ListUnspentWitness returns all unspent outputs which are version 0
|
// ListUnspentWitness returns all unspent outputs which are version 0
|
||||||
// witness programs. The 'confirms' parameter indicates the minimum
|
// witness programs. The 'confirms' parameter indicates the minimum
|
||||||
|
Loading…
x
Reference in New Issue
Block a user