| 1243 | } |
| 1244 | |
| 1245 | static bool |
| 1246 | failure_is_blockheight_disagreement(const struct payment *p, |
| 1247 | u32 *blockheight) |
| 1248 | { |
| 1249 | struct amount_msat unused; |
| 1250 | |
| 1251 | assert(p && p->result); |
| 1252 | |
| 1253 | if (p->result->failcode == 17 /* Former final_expiry_too_soon */) |
| 1254 | *blockheight = p->start_block + 1; |
| 1255 | else if (!fromwire_incorrect_or_unknown_payment_details( |
| 1256 | p->result->raw_message, |
| 1257 | &unused, blockheight)) |
| 1258 | /* If it's incorrect_or_unknown_payment_details, that tells us |
| 1259 | * what height they're at */ |
| 1260 | return false; |
| 1261 | |
| 1262 | /* If we are already at the desired blockheight there is no point in |
| 1263 | * waiting, and it is likely just some other error. Notice that |
| 1264 | * start_block gets set by the initial getinfo call for each |
| 1265 | * attempt.*/ |
| 1266 | if (*blockheight <= p->start_block) |
| 1267 | return false; |
| 1268 | |
| 1269 | return true; |
| 1270 | } |
| 1271 | |
| 1272 | static char *describe_failcode(const tal_t *ctx, enum onion_wire failcode) |
| 1273 | { |
no outgoing calls
no test coverage detected