core-lightning/common/hsm_capable.c
Ken Sedgwick d463b8d900 channeld: add hsm_capabilities and add hsm_is_capable to common
Changelog-Added: Added hsm_capabilities and hsm_is_capable to channeld.
2024-01-29 12:02:37 +10:30

14 lines
323 B
C

#include "config.h"
#include <common/hsm_capable.h>
/* Is this capability supported by the HSM? (So far, always a message
* number) */
bool hsm_is_capable(const u32 *capabilities, u32 msgtype)
{
for (size_t i = 0; i < tal_count(capabilities); i++) {
if (capabilities[i] == msgtype)
return true;
}
return false;
}