cmd/pool: make min_chan_amt mandatory in auto mode

To avoid running into an error during automatic bid order submission
when offering a sidecar channel, we need to make the --min_chan_amt flag
of the order mandatory.
This commit is contained in:
Oliver Gugger 2021-10-27 15:34:13 +02:00
parent 262eb198c5
commit 856e09e80d
No known key found for this signature in database
GPG key ID: 8E4256593F177720

View file

@ -128,6 +128,14 @@ func sidecarOffer(ctx *cli.Context) error {
}
} else {
// We must make sure that the min chan amount is set to the full
// order amount, otherwise we'll get an error during the auto
// bid submission.
if ctx.Uint64("amt") != ctx.Uint64("min_chan_amt") {
return fmt.Errorf("must set --min_chan_amt to same " +
"value as --amt")
}
// Otherwise, will parse out the full bid as normal.
bid, _, err = parseBaseBid(ctx)
if err != nil {