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

Function equal

tests/fuzz/fuzz-wire-open_channel2.c:75–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75static bool equal(const struct open_channel2 *x, const struct open_channel2 *y)
76{
77 size_t upto_channel_flags = (uintptr_t)&x->channel_flags - (uintptr_t)x;
78 if (memcmp(x, y, upto_channel_flags) != 0)
79 return false;
80 if (x->channel_flags != y->channel_flags)
81 return false;
82
83 assert(x->tlvs && y->tlvs);
84
85 if (!tal_arr_eq(x->tlvs->upfront_shutdown_script,
86 y->tlvs->upfront_shutdown_script))
87 return false;
88
89 if (!tal_arr_eq(x->tlvs->channel_type, y->tlvs->channel_type))
90 return false;
91
92 if (!request_funds_equal(x->tlvs->request_funds,
93 y->tlvs->request_funds))
94 return false;
95
96 return !!x->tlvs->require_confirmed_inputs ==
97 !!y->tlvs->require_confirmed_inputs;
98}
99
100void run(const u8 *data, size_t size)
101{

Callers

nothing calls this directly

Calls 1

request_funds_equalFunction · 0.85

Tested by

no test coverage detected