diff --git a/src/index.mjs b/src/index.mjs index b2df75f..4ff8637 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -15,6 +15,7 @@ helixbridge helixbridge register --group=mainnet --datadir=/path/to/config + --accept encrypt encrypt a private key helixbridge encrypt diff --git a/src/register/index.js b/src/register/index.js index dc7042d..2a911a1 100644 --- a/src/register/index.js +++ b/src/register/index.js @@ -150,18 +150,22 @@ async function handle(options) { return; } - await safe.init(options); - switch (register.type) { - case 'lnv3': - await lnv3.register(options); - break; - case 'lnv2-default': - await lnv2Default.register(options); - break; - case 'lnv2-opposite': - await lnv2Opposite.register(options); - break; + const accepted = arg.option('accept'); + if (accepted) { + await safe.init(options); + switch (register.type) { + case 'lnv3': + await lnv3.register(options); + break; + case 'lnv2-default': + await lnv2Default.register(options); + break; + case 'lnv2-opposite': + await lnv2Opposite.register(options); + break; + } } + await ensureLock(ensureLockOptions, true); console.log(chalk.green(`the bridge ${_identifyRegisterName(register)} registered`)); }