rpc: minConfs and spendUnconfirmed for EstimateFee
This commit is contained in:
8 files changed
+855
-738
No files matched your search
@@ -519,7 +519,8 @@ func (b *BtcWallet) SendOutputs(outputs []*wire.TxOut,
|
||||
//
|
||||
// This is a part of the WalletController interface.
|
||||
func (b *BtcWallet) CreateSimpleTx(outputs []*wire.TxOut,
|
||||
feeRate chainfee.SatPerKWeight, dryRun bool) (*txauthor.AuthoredTx, error) {
|
||||
feeRate chainfee.SatPerKWeight, minConfs int32,
|
||||
dryRun bool) (*txauthor.AuthoredTx, error) {
|
||||
|
||||
// The fee rate is passed in using units of sat/kw, so we'll convert
|
||||
// this to sat/KB as the CreateSimpleTx method requires this unit.
|
||||
@@ -529,6 +530,12 @@ func (b *BtcWallet) CreateSimpleTx(outputs []*wire.TxOut,
|
||||
if len(outputs) < 1 {
|
||||
return nil, lnwallet.ErrNoOutputs
|
||||
}
|
||||
|
||||
// Sanity check minConfs.
|
||||
if minConfs < 0 {
|
||||
return nil, lnwallet.ErrInvalidMinconf
|
||||
}
|
||||
|
||||
for _, output := range outputs {
|
||||
// When checking an output for things like dusty-ness, we'll
|
||||
// use the default mempool relay fee rather than the target
|
||||
@@ -544,7 +551,7 @@ func (b *BtcWallet) CreateSimpleTx(outputs []*wire.TxOut,
|
||||
}
|
||||
|
||||
return b.wallet.CreateSimpleTx(
|
||||
nil, defaultAccount, outputs, 1, feeSatPerKB, dryRun,
|
||||
nil, defaultAccount, outputs, minConfs, feeSatPerKB, dryRun,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user