MCPcopy Create free account
hub / github.com/ElementsProject/lightning / read_stdin_mnemonic

Function read_stdin_mnemonic

common/hsm_secret.c:454–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454const char *read_stdin_mnemonic(const tal_t *ctx, enum hsm_secret_error *err)
455{
456 printf("Introduce your BIP39 word list separated by space (at least 12 words):\n");
457 fflush(stdout);
458
459 const char *line = read_line(ctx);
460 if (!line) {
461 *err = HSM_SECRET_ERR_INVALID_FORMAT;
462 return NULL;
463 }
464
465 /* Validate mnemonic */
466 *err = validate_mnemonic(line);
467 if (*err != HSM_SECRET_OK) {
468 return tal_free(line);
469 }
470
471 *err = HSM_SECRET_OK;
472 return line;
473}
474
475int is_legacy_hsm_secret_encrypted(const char *path)
476{

Callers 2

generate_hsmFunction · 0.85
check_hsmFunction · 0.85

Calls 3

read_lineFunction · 0.85
validate_mnemonicFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected