hsmd: make the negotiated hsmd version available to libhsmd

Changelog-None: hsmd internals
This commit is contained in:
Ken Sedgwick 2024-03-15 14:16:02 -07:00 committed by Alex Myers
parent a02cc6441a
commit 37fe32aa17
3 changed files with 8 additions and 2 deletions

View File

@ -511,8 +511,8 @@ static struct io_plan *init_hsm(struct io_conn *conn,
discard_key(take(hsm_encryption_key));
/* Define the minimum common max version for the hsmd one */
u64 mutual_version = maxversion < our_maxversion ? maxversion : our_maxversion;
return req_reply(conn, c, hsmd_init(hsm_secret, mutual_version,
hsmd_mutual_version = maxversion < our_maxversion ? maxversion : our_maxversion;
return req_reply(conn, c, hsmd_init(hsm_secret, hsmd_mutual_version,
bip32_key_version));
}

View File

@ -15,6 +15,9 @@
#include <sodium/utils.h>
#include <wally_psbt.h>
/* The negotiated protocol version ends up in here. */
u64 hsmd_mutual_version;
/* If they specify --dev-force-privkey it ends up in here. */
struct privkey *dev_force_privkey;
/* If they specify --dev-force-bip32-seed it ends up in here. */

View File

@ -89,6 +89,9 @@ void hsmd_status_failed(enum status_failreason code,
bool hsmd_check_client_capabilities(struct hsmd_client *client,
enum hsmd_wire t);
/* The negotiated protocol version ends up in here. */
extern u64 hsmd_mutual_version;
/* If they specify --dev-force-privkey it ends up in here. */
extern struct privkey *dev_force_privkey;
/* If they specify --dev-force-bip32-seed it ends up in here. */