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

Function shachain_get_secret

common/derive_basepoints.c:253–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253bool shachain_get_secret(const struct shachain *shachain,
254 u64 commit_num,
255 struct secret *preimage)
256{
257 struct sha256 sha;
258
259 if (commit_num >= (1ULL << SHACHAIN_BITS))
260 return false;
261
262 if (!shachain_get_hash(shachain, shachain_index(commit_num), &sha))
263 return false;
264 CROSS_TYPE_ASSIGNMENT(preimage, &sha);
265 return true;
266}

Callers 2

send_reestablishFunction · 0.50
peer_start_channeldFunction · 0.50

Calls 2

shachain_get_hashFunction · 0.85
shachain_indexFunction · 0.85

Tested by

no test coverage detected