lncli: add coin selection strategy option to on-chain rpc commands

In this commit we add coin selection strategy option to the
following on-chain rpc commands `fundpsbt`, `fundtemplatepsbt`,
`batchopenchannel`, `estimatefee`, `sendcoins`, and `sendmany`.
This commit is contained in:
Mohamed Awnallah committed 2024-04-01 19:08:19 +02:00
1 parent 7c2c0dcf98
commit a0b0e7aa62
4 files changed
+106 -26

No files matched your search

+12 -5
View File
@@ -817,6 +817,7 @@ var batchOpenChannelCommand = cli.Command{
"transaction when storing it to the local " +
"wallet after publishing it",
},
coinSelectionStrategyFlag,
},
Action: actionDecorator(batchOpenChannel),
}
@@ -845,13 +846,19 @@ func batchOpenChannel(ctx *cli.Context) error {
return nil
}
coinSelectionStrategy, err := parseCoinSelectionStrategy(ctx)
if err != nil {
return err
}
minConfs := int32(ctx.Uint64("min_confs"))
req := &lnrpc.BatchOpenChannelRequest{
TargetConf: int32(ctx.Int64("conf_target")),
SatPerVbyte: int64(ctx.Uint64("sat_per_vbyte")),
MinConfs: minConfs,
SpendUnconfirmed: minConfs == 0,
Label: ctx.String("label"),
TargetConf: int32(ctx.Int64("conf_target")),
SatPerVbyte: int64(ctx.Uint64("sat_per_vbyte")),
MinConfs: minConfs,
SpendUnconfirmed: minConfs == 0,
Label: ctx.String("label"),
CoinSelectionStrategy: coinSelectionStrategy,
}
// Let's try and parse the JSON part of the CLI now. Fortunately we can