| 60 | } |
| 61 | |
| 62 | static 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) |
nothing calls this directly
no test coverage detected