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

Function report_tampering

plugins/libplugin-pay.c:1068–1090  ·  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

1066/* If a node takes too much fee or cltv, the next one reports it. We don't
1067 * know who to believe, but log it */
1068static void report_tampering(struct payment *p,
1069 size_t report_pos,
1070 const char *style)
1071{
1072 const struct node_id *id = &p->route[report_pos].node_id;
1073
1074 if (report_pos == 0) {
1075 paymod_log(p, LOG_UNUSUAL,
1076 "Node #%zu (%s) claimed we sent them invalid %s",
1077 report_pos + 1,
1078 type_to_string(tmpctx, struct node_id, id),
1079 style);
1080 } else {
1081 paymod_log(p, LOG_UNUSUAL,
1082 "Node #%zu (%s) claimed #%zu (%s) sent them invalid %s",
1083 report_pos + 1,
1084 type_to_string(tmpctx, struct node_id, id),
1085 report_pos,
1086 type_to_string(tmpctx, struct node_id,
1087 &p->route[report_pos-1].node_id),
1088 style);
1089 }
1090}
1091
1092static bool
1093failure_is_blockheight_disagreement(const struct payment *p,

Callers 2

handle_final_failureFunction · 0.85

Calls 2

paymod_logFunction · 0.85
type_to_stringClass · 0.50

Tested by

no test coverage detected