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

Function describe_failcode

plugins/libplugin-pay.c:1272–1293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1270}
1271
1272static char *describe_failcode(const tal_t *ctx, enum onion_wire failcode)
1273{
1274 char *rv = tal_strdup(ctx, "");
1275 if (failcode & BADONION) {
1276 tal_append_fmt(&rv, "BADONION|");
1277 failcode &= ~BADONION;
1278 }
1279 if (failcode & PERM) {
1280 tal_append_fmt(&rv, "PERM|");
1281 failcode &= ~PERM;
1282 }
1283 if (failcode & NODE) {
1284 tal_append_fmt(&rv, "NODE|");
1285 failcode &= ~NODE;
1286 }
1287 if (failcode & UPDATE) {
1288 tal_append_fmt(&rv, "UPDATE|");
1289 failcode &= ~UPDATE;
1290 }
1291 tal_append_fmt(&rv, "%u", failcode);
1292 return rv;
1293}
1294
1295static struct command_result *
1296handle_final_failure(struct command *cmd,

Callers 2

handle_final_failureFunction · 0.85

Calls 1

tal_append_fmtFunction · 0.85

Tested by

no test coverage detected