| 1090 | } |
| 1091 | |
| 1092 | static bool |
| 1093 | failure_is_blockheight_disagreement(const struct payment *p, |
| 1094 | u32 *blockheight) |
| 1095 | { |
| 1096 | struct amount_msat unused; |
| 1097 | |
| 1098 | assert(p && p->result); |
| 1099 | |
| 1100 | if (p->result->failcode == 17 /* Former final_expiry_too_soon */) |
| 1101 | *blockheight = p->start_block + 1; |
| 1102 | else if (!fromwire_incorrect_or_unknown_payment_details( |
| 1103 | p->result->raw_message, |
| 1104 | &unused, blockheight)) |
| 1105 | /* If it's incorrect_or_unknown_payment_details, that tells us |
| 1106 | * what height they're at */ |
| 1107 | return false; |
| 1108 | |
| 1109 | /* If we are already at the desired blockheight there is no point in |
| 1110 | * waiting, and it is likely just some other error. Notice that |
| 1111 | * start_block gets set by the initial getinfo call for each |
| 1112 | * attempt.*/ |
| 1113 | if (*blockheight <= p->start_block) |
| 1114 | return false; |
| 1115 | |
| 1116 | return true; |
| 1117 | } |
| 1118 | |
| 1119 | static char *describe_failcode(const tal_t *ctx, enum onion_wire failcode) |
| 1120 | { |
no outgoing calls
no test coverage detected