Skip to content

Commit 7b2c561

Browse files
ksedgwicendothermicdev
authored andcommitted
hsmd: increase HSM_MAX_VERSION to 3
1 parent a4dc714 commit 7b2c561

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

common/hsm_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define HSM_MIN_VERSION 1
1212

1313
/* wire/hsmd_wire.csv contents version:
14-
* dd89bf9323dff42200003fb864abb6608f3aa645b636fdae3ec81d804ac05196
14+
* edd3d288fc88a5470adc2f99abcbfe4d4af29fae0c7a80b4226f28810a815524
1515
*/
16-
#define HSM_MAX_VERSION 2
16+
#define HSM_MAX_VERSION 3
1717
#endif /* LIGHTNING_COMMON_HSM_VERSION_H */

hsmd/hsmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ static struct io_plan *init_hsm(struct io_conn *conn,
444444
struct secret *hsm_encryption_key;
445445
struct bip32_key_version bip32_key_version;
446446
u32 minversion, maxversion;
447-
const u32 our_minversion = 2, our_maxversion = 2;
447+
const u32 our_minversion = 2, our_maxversion = 3;
448448

449449
/* This must be lightningd. */
450450
assert(is_lightningd(c));

lightningd/hsm_control.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ struct ext_key *hsm_init(struct lightningd *ld)
104104
}
105105

106106
ld->hsm_fd = fds[0];
107+
u32 min_version = 3; /* payment modifiers need hsmd_preapprove_{invoice,keysend} */
107108
if (!wire_sync_write(ld->hsm_fd, towire_hsmd_init(tmpctx,
108109
&chainparams->bip32_key_version,
109110
chainparams,
@@ -112,7 +113,7 @@ struct ext_key *hsm_init(struct lightningd *ld)
112113
IFDEV(ld->dev_force_bip32_seed, NULL),
113114
IFDEV(ld->dev_force_channel_secrets, NULL),
114115
IFDEV(ld->dev_force_channel_secrets_shaseed, NULL),
115-
HSM_MIN_VERSION,
116+
min_version,
116117
HSM_MAX_VERSION)))
117118
err(EXITCODE_HSM_GENERIC_ERROR, "Writing init msg to hsm");
118119

0 commit comments

Comments
 (0)