@@ -112,6 +112,9 @@ bool hsmd_check_client_capabilities(struct hsmd_client *client,
112112 case WIRE_HSMD_SIGN_OPTION_WILL_FUND_OFFER :
113113 return (client -> capabilities & HSM_PERM_SIGN_WILL_FUND_OFFER ) != 0 ;
114114
115+ case WIRE_HSMD_SYNC_OUTPOINT :
116+ return (client -> capabilities & HSM_PERM_SYNC_OUTPOINT ) != 0 ;
117+
115118 case WIRE_HSMD_INIT :
116119 case WIRE_HSMD_NEW_CHANNEL :
117120 case WIRE_HSMD_CLIENT_HSMFD :
@@ -144,6 +147,7 @@ bool hsmd_check_client_capabilities(struct hsmd_client *client,
144147 case WIRE_HSMD_CLIENT_HSMFD_REPLY :
145148 case WIRE_HSMD_NEW_CHANNEL_REPLY :
146149 case WIRE_HSMD_SETUP_CHANNEL_REPLY :
150+ case WIRE_HSMD_SYNC_OUTPOINT_REPLY :
147151 case WIRE_HSMD_NODE_ANNOUNCEMENT_SIG_REPLY :
148152 case WIRE_HSMD_SIGN_WITHDRAWAL_REPLY :
149153 case WIRE_HSMD_SIGN_INVOICE_REPLY :
@@ -379,6 +383,20 @@ static u8 *handle_setup_channel(struct hsmd_client *c, const u8 *msg_in)
379383 return towire_hsmd_setup_channel_reply (NULL );
380384}
381385
386+ /* ~This stub implementation is overriden by fully validating signers
387+ * to ensure they are caught up when outpoints are freshly buried */
388+ static u8 * handle_sync_outpoint (struct hsmd_client * c , const u8 * msg_in )
389+ {
390+ struct bitcoin_outpoint outpoint ;
391+
392+ if (!fromwire_hsmd_sync_outpoint (msg_in , & outpoint ))
393+ return hsmd_status_malformed_request (c , msg_in );
394+
395+ /* Stub implementation */
396+
397+ return towire_hsmd_setup_channel_reply (NULL );
398+ }
399+
382400/*~ For almost every wallet tx we use the BIP32 seed, but not for onchain
383401 * unilateral closes from a peer: they (may) have an output to us using a
384402 * public key based on the channel basepoints. It's a bit spammy to spend
@@ -1906,6 +1924,8 @@ u8 *hsmd_handle_client_message(const tal_t *ctx, struct hsmd_client *client,
19061924 return handle_new_channel (client , msg );
19071925 case WIRE_HSMD_SETUP_CHANNEL :
19081926 return handle_setup_channel (client , msg );
1927+ case WIRE_HSMD_SYNC_OUTPOINT :
1928+ return handle_sync_outpoint (client , msg );
19091929 case WIRE_HSMD_GET_OUTPUT_SCRIPTPUBKEY :
19101930 return handle_get_output_scriptpubkey (client , msg );
19111931 case WIRE_HSMD_CHECK_FUTURE_SECRET :
@@ -1983,6 +2003,7 @@ u8 *hsmd_handle_client_message(const tal_t *ctx, struct hsmd_client *client,
19832003 case WIRE_HSMD_CLIENT_HSMFD_REPLY :
19842004 case WIRE_HSMD_NEW_CHANNEL_REPLY :
19852005 case WIRE_HSMD_SETUP_CHANNEL_REPLY :
2006+ case WIRE_HSMD_SYNC_OUTPOINT_REPLY :
19862007 case WIRE_HSMD_NODE_ANNOUNCEMENT_SIG_REPLY :
19872008 case WIRE_HSMD_SIGN_WITHDRAWAL_REPLY :
19882009 case WIRE_HSMD_SIGN_INVOICE_REPLY :
0 commit comments