Skip to content

Commit f74d234

Browse files
committed
Changed "warmstart" to "coldstart" (inverted semantic).
1 parent a14f776 commit f74d234

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

contrib/remote_hsmd/hsmd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ static struct io_plan *init_hsm(struct io_conn *conn,
360360
struct sha256 *force_channel_secrets_shaseed;
361361
struct secret *hsm_encryption_key;
362362
struct secret hsm_secret;
363-
bool warmstart;
363+
bool coldstart;
364364

365365
/* This must be lightningd. */
366366
assert(is_lightningd(c));
@@ -408,10 +408,10 @@ static struct io_plan *init_hsm(struct io_conn *conn,
408408
}
409409

410410
/* Is this a warm start (restart) or a cold start (first time)? */
411-
warmstart = access("INITED", F_OK) != -1;
411+
coldstart = access("WARM", F_OK) == -1;
412412

413413
proxy_stat rv = proxy_init_hsm(&bip32_key_version, chainparams,
414-
warmstart, &hsm_secret,
414+
coldstart, &hsm_secret,
415415
&node_id, &pubstuff.bip32);
416416
if (PROXY_PERMANENT(rv)) {
417417
status_failed(STATUS_FAIL_INTERNAL_ERROR,
@@ -427,7 +427,7 @@ static struct io_plan *init_hsm(struct io_conn *conn,
427427
}
428428

429429
/* Mark this node as already inited. */
430-
int fd = open("INITED", O_WRONLY|O_TRUNC|O_CREAT, 0666);
430+
int fd = open("WARM", O_WRONLY|O_TRUNC|O_CREAT, 0666);
431431
assert(fd != -1);
432432
close(fd);
433433

contrib/remote_hsmd/proxy.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,16 +323,16 @@ void proxy_setup()
323323

324324
proxy_stat proxy_init_hsm(struct bip32_key_version *bip32_key_version,
325325
struct chainparams const *chainparams,
326-
bool warmstart,
326+
bool coldstart,
327327
struct secret *hsm_secret,
328328
struct node_id *o_node_id,
329329
struct ext_key *o_ext_pubkey)
330330
{
331331
status_debug(
332-
"%s:%d %s hsm_secret=%s warmstart=%s",
332+
"%s:%d %s hsm_secret=%s coldstart=%s",
333333
__FILE__, __LINE__, __FUNCTION__,
334334
dump_secret(hsm_secret).c_str(),
335-
warmstart ? "true" : "false"
335+
coldstart ? "true" : "false"
336336
);
337337

338338
/* First we make the Init call to create the Node. */
@@ -343,7 +343,7 @@ proxy_stat proxy_init_hsm(struct bip32_key_version *bip32_key_version,
343343
auto cp = req.mutable_chainparams();
344344
cp->set_network_name(chainparams->network_name);
345345

346-
req.set_warmstart(warmstart);
346+
req.set_coldstart(coldstart);
347347

348348
/* FIXME - Sending the secret instead of generating on
349349
* the remote. */

contrib/remote_hsmd/proxy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void proxy_setup(void);
3030
proxy_stat proxy_init_hsm(
3131
struct bip32_key_version *bip32_key_version,
3232
struct chainparams const *chainparams,
33-
bool warmstart,
33+
bool coldstart,
3434
struct secret *hsm_secret,
3535
struct node_id *o_node_id,
3636
struct ext_key *o_ext_pub_key);

0 commit comments

Comments
 (0)