mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-27 14:06:39 +02:00
walletrpc+subserver_config: add coin selection strategy
With this commit we also add the config-level coin selection strategy to the wallet RPC server.
This commit is contained in:
@@ -5,6 +5,7 @@ package walletrpc
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/btcsuite/btcd/chaincfg"
|
"github.com/btcsuite/btcd/chaincfg"
|
||||||
|
"github.com/btcsuite/btcwallet/wallet"
|
||||||
"github.com/lightningnetwork/lnd/keychain"
|
"github.com/lightningnetwork/lnd/keychain"
|
||||||
"github.com/lightningnetwork/lnd/lnwallet"
|
"github.com/lightningnetwork/lnd/lnwallet"
|
||||||
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
||||||
@@ -71,4 +72,8 @@ type Config struct {
|
|||||||
// CurrentNumAnchorChans returns the current number of non-private
|
// CurrentNumAnchorChans returns the current number of non-private
|
||||||
// anchor channels the wallet should be ready to fee bump if needed.
|
// anchor channels the wallet should be ready to fee bump if needed.
|
||||||
CurrentNumAnchorChans func() (int, error)
|
CurrentNumAnchorChans func() (int, error)
|
||||||
|
|
||||||
|
// CoinSelectionStrategy is the strategy that is used for selecting
|
||||||
|
// coins when funding a transaction.
|
||||||
|
CoinSelectionStrategy wallet.CoinSelectionStrategy
|
||||||
}
|
}
|
||||||
|
@@ -197,6 +197,11 @@ func (s *subRPCServerConfigs) PopulateDependencies(cfg *Config,
|
|||||||
subCfgValue.FieldByName("CurrentNumAnchorChans").Set(
|
subCfgValue.FieldByName("CurrentNumAnchorChans").Set(
|
||||||
reflect.ValueOf(cc.Wallet.CurrentNumAnchorChans),
|
reflect.ValueOf(cc.Wallet.CurrentNumAnchorChans),
|
||||||
)
|
)
|
||||||
|
subCfgValue.FieldByName("CoinSelectionStrategy").Set(
|
||||||
|
reflect.ValueOf(
|
||||||
|
cc.Wallet.Cfg.CoinSelectionStrategy,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
case *autopilotrpc.Config:
|
case *autopilotrpc.Config:
|
||||||
subCfgValue := extractReflectValue(subCfg)
|
subCfgValue := extractReflectValue(subCfg)
|
||||||
|
Reference in New Issue
Block a user