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

lightningd: Check bitcoind version when setup_topology #2859

Merged
merged 3 commits into from
Jul 30, 2019

Conversation

trueptolemy
Copy link
Collaborator

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:

  • Add the cli_min_supported_version field in chainparams:
    it's numeric version for bitcoind, now set all cli_min_supported_version as 150000;
  • Call getnetworkinfor (call getinfor for the version older than v0.16.0) to get the numeric version and check if the version is supported.

Set the min supported numeric version of cli as 150000.
lightningd/bitcoind.c Outdated Show resolved Hide resolved
@trueptolemy trueptolemy force-pushed the check-bitcoind-version branch 3 times, most recently from 9dfc67f to df8770c Compare July 29, 2019 09:17
@cdecker
Copy link
Member

cdecker commented Jul 29, 2019

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

lightningd/bitcoind.c Outdated Show resolved Hide resolved
Copy link
Collaborator

@ZmnSCPxj ZmnSCPxj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK b00ad8c

@ZmnSCPxj ZmnSCPxj merged commit 0ae2039 into ElementsProject:master Jul 30, 2019
@@ -86,6 +90,7 @@ const struct chainparams networks[] = {
.rpc_port = 9332,
.cli = "litecoin-cli",
.cli_args = NULL,
.cli_min_supported_version = 150000,
Copy link
Contributor

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)?",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"(%.*s)?" wrong format?

Copy link
Collaborator

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).

Copy link
Contributor

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.

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

Successfully merging this pull request may close these issues.

Check bitcoind version atstartup
5 participants