forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
channeld: add hsm_capabilities and add hsm_is_capable to common
Changelog-Added: Added hsm_capabilities and hsm_is_capable to channeld.
- Loading branch information
Showing
9 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#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(u32 *capabilities, u32 msgtype) | ||
{ | ||
for (size_t i = 0; i < tal_count(capabilities); i++) { | ||
if (capabilities[i] == msgtype) | ||
return true; | ||
} | ||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef LIGHTNING_COMMON_HSM_CAPABLE_H | ||
#define LIGHTNING_COMMON_HSM_CAPABLE_H | ||
#include "config.h" | ||
#include <ccan/short_types/short_types.h> | ||
#include <ccan/tal/tal.h> | ||
#include <stdbool.h> | ||
|
||
/* Is this capability supported by the HSM? (So far, always a message | ||
* number) */ | ||
bool hsm_is_capable(u32 *capabilities, u32 msgtype); | ||
#endif /* LIGHTNING_COMMON_HSM_CAPABLE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters