hsmd: fix capability check for signing splices.

The nomenclature confusion mean that we were ANDING a capability
with a message number (29) which always returned non-zero.  We really
do need a new capability which we can hand to channeld to make these
splice txs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-08-07 15:21:41 +09:30
parent d95cfc0b64
commit ac092c0bf9
3 changed files with 4 additions and 2 deletions

View file

@ -107,7 +107,7 @@ bool hsmd_check_client_capabilities(struct hsmd_client *client,
return (client->capabilities & HSM_PERM_SIGN_CLOSING_TX) != 0;
case WIRE_HSMD_SIGN_SPLICE_TX:
return (client->capabilities & WIRE_HSMD_SIGN_SPLICE_TX) != 0;
return (client->capabilities & HSM_PERM_SIGN_SPLICE_TX) != 0;
case WIRE_HSMD_SIGN_OPTION_WILL_FUND_OFFER:
return (client->capabilities & HSM_PERM_SIGN_WILL_FUND_OFFER) != 0;

View file

@ -9,6 +9,7 @@
#define HSM_PERM_SIGN_REMOTE_TX 16
#define HSM_PERM_SIGN_CLOSING_TX 32
#define HSM_PERM_SIGN_WILL_FUND_OFFER 64
#define HSM_PERM_SIGN_SPLICE_TX 128
#define HSM_PERM_MASTER 1024
#endif /* LIGHTNING_HSMD_PERMISSIONS_H */

View file

@ -1269,7 +1269,8 @@ bool peer_start_channeld(struct channel *channel,
| HSM_PERM_COMMITMENT_POINT
| HSM_PERM_SIGN_REMOTE_TX
| HSM_PERM_SIGN_ONCHAIN_TX
| HSM_PERM_SIGN_CLOSING_TX);
| HSM_PERM_SIGN_CLOSING_TX
| HSM_PERM_SIGN_SPLICE_TX);
channel_set_owner(channel,
new_channel_subd(channel, ld,