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

Function field_diff_

plugins/fetchinvoice.c:62–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62static const char *field_diff_(struct plugin *plugin,
63 const tal_t *a, const tal_t *b,
64 const char *fieldname)
65{
66 /* One is set and the other isn't? */
67 if ((a == NULL) != (b == NULL)) {
68 plugin_log(plugin, LOG_DBG, "field_diff %s: a is %s, b is %s",
69 fieldname, a ? "set": "unset", b ? "set": "unset");
70 return fieldname;
71 }
72 if (!memeq(a, tal_bytelen(a), b, tal_bytelen(b))) {
73 plugin_log(plugin, LOG_DBG, "field_diff %s: a=%s, b=%s",
74 fieldname, tal_hex(tmpctx, a), tal_hex(tmpctx, b));
75 return fieldname;
76 }
77 return NULL;
78}
79
80#define field_diff(a, b, fieldname) \
81 field_diff_((cmd)->plugin, a->fieldname, b->fieldname, #fieldname)

Callers

nothing calls this directly

Calls 4

memeqFunction · 0.85
tal_bytelenFunction · 0.85
tal_hexFunction · 0.85
plugin_logFunction · 0.70

Tested by

no test coverage detected