From 856e09e80dfd396a1fbb0424c43f8ee147e2dd16 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Wed, 27 Oct 2021 15:34:13 +0200 Subject: [PATCH] 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. --- cmd/pool/sidecar.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/pool/sidecar.go b/cmd/pool/sidecar.go index 19a27b5..afdaea4 100644 --- a/cmd/pool/sidecar.go +++ b/cmd/pool/sidecar.go @@ -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 {