Skip to content

Commit

Permalink
check if protocol-no-anchors has not been set and add warning about z…
Browse files Browse the repository at this point in the history
…ero-conf channels
  • Loading branch information
remcoros committed May 16, 2024
1 parent f89636f commit 849474b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/services/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({
"name": "Enable zero-conf Channels",
"description":
"Set to enable support for zero-conf channels. This requires the option-scid-alias flag to also be set.\n",
"warning":
"Zero-conf channels are channels that do not require confirmations to be used. Because of this, the fundee must trust the funder to not double-spend the channel and steal the balance of the channel.",
"default": false,
},
"protocol-option-scid-alias": {
Expand Down
7 changes: 7 additions & 0 deletions scripts/services/setConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ const configRules: Array<Check> = [
}
},
},
{
currentError(config) {
if (config.advanced["protocol-zero-conf"] && config.advanced["protocol-no-anchors"]) {
return "'Advanced > Disable Anchor Channels' must be disabled to enable zero-conf channels'";
}
},
},
];

function checkConfigRules(config: Root): T.KnownError | void {
Expand Down

0 comments on commit 849474b

Please sign in to comment.