MCPcopy Create free account
hub / github.com/ElementsProject/lightning / shachain_index

Function shachain_index

common/derive_basepoints.h:137–142  ·  view source on GitHub ↗

BOLT #3: * * The first secret used: * - MUST be index 281474976710655, * - and from there, the index is decremented. */

Source from the content-addressed store, hash-verified

135 * - and from there, the index is decremented.
136 */
137static inline u64 shachain_index(u64 per_commit_index)
138{
139 BUILD_ASSERT((1ULL << SHACHAIN_BITS)-1 == 281474976710655);
140 assert(per_commit_index < (1ULL << SHACHAIN_BITS));
141 return (1ULL << SHACHAIN_BITS)-1 - per_commit_index;
142}
143
144static inline u64 revocations_received(const struct shachain *shachain)
145{

Callers 3

peer_got_revokeFunction · 0.85
per_commit_secretFunction · 0.85
shachain_get_secretFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected