multi: add random coin selection

This commit is contained in:
Joost Jager
2021-03-29 15:23:46 +02:00
parent 4f98cea820
commit 42f4afef75
10 changed files with 63 additions and 22 deletions

13
lnd.go
View File

@@ -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,
)