From f7198c4105e9bc04c1cbf7b77f547ed3af3d6078 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 6 Feb 2024 12:25:46 +0100 Subject: [PATCH] walletrpc+subserver_config: add coin selection strategy With this commit we also add the config-level coin selection strategy to the wallet RPC server. --- lnrpc/walletrpc/config_active.go | 5 +++++ subrpcserver_config.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lnrpc/walletrpc/config_active.go b/lnrpc/walletrpc/config_active.go index 532ca7324..4629ca287 100644 --- a/lnrpc/walletrpc/config_active.go +++ b/lnrpc/walletrpc/config_active.go @@ -5,6 +5,7 @@ package walletrpc import ( "github.com/btcsuite/btcd/chaincfg" + "github.com/btcsuite/btcwallet/wallet" "github.com/lightningnetwork/lnd/keychain" "github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwallet/chainfee" @@ -71,4 +72,8 @@ type Config struct { // CurrentNumAnchorChans returns the current number of non-private // anchor channels the wallet should be ready to fee bump if needed. CurrentNumAnchorChans func() (int, error) + + // CoinSelectionStrategy is the strategy that is used for selecting + // coins when funding a transaction. + CoinSelectionStrategy wallet.CoinSelectionStrategy } diff --git a/subrpcserver_config.go b/subrpcserver_config.go index b4b004152..6687f71a7 100644 --- a/subrpcserver_config.go +++ b/subrpcserver_config.go @@ -197,6 +197,11 @@ func (s *subRPCServerConfigs) PopulateDependencies(cfg *Config, subCfgValue.FieldByName("CurrentNumAnchorChans").Set( reflect.ValueOf(cc.Wallet.CurrentNumAnchorChans), ) + subCfgValue.FieldByName("CoinSelectionStrategy").Set( + reflect.ValueOf( + cc.Wallet.Cfg.CoinSelectionStrategy, + ), + ) case *autopilotrpc.Config: subCfgValue := extractReflectValue(subCfg)