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

Function report_tampering

plugins/libplugin-pay.c:1222–1243  ·  view source on GitHub ↗

If a node takes too much fee or cltv, the next one reports it. We don't * know who to believe, but log it */

Source from the content-addressed store, hash-verified

1220/* If a node takes too much fee or cltv, the next one reports it. We don't
1221 * know who to believe, but log it */
1222static void report_tampering(struct payment *p,
1223 size_t report_pos,
1224 const char *style)
1225{
1226 const struct node_id *id = &p->route[report_pos].node_id;
1227
1228 if (report_pos == 0) {
1229 paymod_log(p, LOG_UNUSUAL,
1230 "Node #%zu (%s) claimed we sent them invalid %s",
1231 report_pos + 1,
1232 fmt_node_id(tmpctx, id),
1233 style);
1234 } else {
1235 paymod_log(p, LOG_UNUSUAL,
1236 "Node #%zu (%s) claimed #%zu (%s) sent them invalid %s",
1237 report_pos + 1,
1238 fmt_node_id(tmpctx, id),
1239 report_pos,
1240 fmt_node_id(tmpctx, &p->route[report_pos-1].node_id),
1241 style);
1242 }
1243}
1244
1245static bool
1246failure_is_blockheight_disagreement(const struct payment *p,

Callers 2

handle_final_failureFunction · 0.85

Calls 2

paymod_logFunction · 0.85
fmt_node_idFunction · 0.85

Tested by

no test coverage detected