Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing negative amount to splice_init fails with unrecognized option #6612

Closed
Sjors opened this issue Aug 24, 2023 · 3 comments · Fixed by #6677
Closed

Passing negative amount to splice_init fails with unrecognized option #6612

Sjors opened this issue Aug 24, 2023 · 3 comments · Fixed by #6677
Assignees

Comments

@Sjors
Copy link
Contributor

Sjors commented Aug 24, 2023

Running v23.08 with experimental_splicing on Ubuntu 23.04, GNU bash, version 5.2.15.

Trying to splice in a positive amount "works" as expected:

lightning-cli splice_init ... 1sat
{
   "code": 354,
   "message": "splicing not supported"
}

Trying to splice out a negative amount doesn't:

lightning-cli splice_init ... -1sat
lightning-cli: -1sat: unrecognized option

I also tried \-1sat and "1sat".

It does seem to work with -k:

lightning-cli splice_init -k channel_id=... amount=-1sat
{
   "code": 354,
   "message": "splicing not supported"
}

Maybe it's easier to just have splice_in_init and splice_out_init with only positive amounts? The rest of the RPCs would stay unchanged.

@ddustin
Copy link
Collaborator

ddustin commented Sep 12, 2023

The thinking was since you can only splice whole sat amounts and building signed the input types to use raw numbers was less effort / complication (sats / msats types do not allow negative values) , using raw signed values would work well for this. But perhaps that's worth reconsidering if it's breaking users' expectations.

@ddustin
Copy link
Collaborator

ddustin commented Sep 13, 2023

There was an issue where negative values (ie -100) would be interpreted as a command named "100".

PR #6675 now special cases "-" followed by a digit as a numerical value instead of an unrecognized command.

@ddustin
Copy link
Collaborator

ddustin commented Sep 19, 2023

Adding the -- technique usage example to the splice_init documentation in PR #6677.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants