-
Notifications
You must be signed in to change notification settings - Fork 889
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
lightningd: Check bitcoind version when setup_topology
#2859
lightningd: Check bitcoind version when setup_topology
#2859
Conversation
Set the min supported numeric version of cli as 150000.
9dfc67f
to
df8770c
Compare
Looks good to me, I think we can just fail with versions <0.14.0, since we don't support them anyway. The error message makes sense so that should work like it is. ACK df8770c |
df8770c
to
b00ad8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK b00ad8c
@@ -86,6 +90,7 @@ const struct chainparams networks[] = { | |||
.rpc_port = 9332, | |||
.cli = "litecoin-cli", | |||
.cli_args = NULL, | |||
.cli_min_supported_version = 150000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
litecoin seems not release 0.15 version.
|
||
if (tokens[0].type != JSMN_OBJECT) { | ||
log_unusual(bcli->bitcoind->log, | ||
"%s: gave non-object (%.*s)?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"(%.*s)?" wrong format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct format. %.*s
means get two arguments: first is length of string, second is string (which might not be null terminated).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, glad to known new tricks.
Fix #2697 .
Corresponding to the comment, this PR add the
check that the bitcoind version must be at least v0.15.0, and any older version will let
lightningd
down.Related changes include:
cli_min_supported_version
field inchainparams
:it's numeric version for
bitcoind
, now set allcli_min_supported_version
as 150000;getnetworkinfor
(callgetinfor
for the version older than v0.16.0) to get the numeric version and check if the version is supported.