mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 15:11:09 +02:00
multi: add random coin selection
This commit is contained in:
13
lnd.go
13
lnd.go
@@ -700,6 +700,19 @@ func Main(cfg *Config, lisCfg ListenerCfg, interceptor signal.Interceptor) error
|
||||
},
|
||||
}
|
||||
|
||||
// Parse coin selection strategy.
|
||||
switch cfg.CoinSelectionStrategy {
|
||||
case "largest":
|
||||
chainControlCfg.CoinSelectionStrategy = wallet.CoinSelectionLargest
|
||||
|
||||
case "random":
|
||||
chainControlCfg.CoinSelectionStrategy = wallet.CoinSelectionRandom
|
||||
|
||||
default:
|
||||
return fmt.Errorf("unknown coin selection strategy %v",
|
||||
cfg.CoinSelectionStrategy)
|
||||
}
|
||||
|
||||
activeChainControl, cleanup, err := chainreg.NewChainControl(
|
||||
chainControlCfg, blockCache,
|
||||
)
|
||||
|
Reference in New Issue
Block a user