mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-29 10:09:08 +02:00
lnrpc+lncli: deprecate sat_per_byte and add sat_per_vbyte
This commit deprecates/replaces the old field `sat_per_byte` with `sat_per_vbyte`. While the old field suggests sat per byte, it’s actually using sat per virtual byte. We use the Hidden param to hide all the deprecated flags. These flags won't show up in help menu onwards, while stay valid that can be passed from cli. Thus bash scripts referencing these fields won't be broken.
This commit is contained in:
@ -240,6 +240,23 @@ func extractPathArgs(ctx *cli.Context) (string, string, error) {
|
||||
return tlsCertPath, macPath, nil
|
||||
}
|
||||
|
||||
// checkNotBothSet accepts two flag names, a and b, and checks that only flag a
|
||||
// or flag b can be set, but not both. It returns the name of the flag or an
|
||||
// error.
|
||||
func checkNotBothSet(ctx *cli.Context, a, b string) (string, error) {
|
||||
if ctx.IsSet(a) && ctx.IsSet(b) {
|
||||
return "", fmt.Errorf(
|
||||
"either %s or %s should be set, but not both", a, b,
|
||||
)
|
||||
}
|
||||
|
||||
if ctx.IsSet(a) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
return b, nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
app := cli.NewApp()
|
||||
app.Name = "lncli"
|
||||
|
Reference in New Issue
Block a user