There are two 33-byte pubkeys possible: choose the one which appears * in the graph (otherwise payment will fail anyway). */
| 1293 | /* There are two 33-byte pubkeys possible: choose the one which appears |
| 1294 | * in the graph (otherwise payment will fail anyway). */ |
| 1295 | void gossmap_guess_node_id(const struct gossmap *map, |
| 1296 | const struct point32 *point32, |
| 1297 | struct node_id *id) |
| 1298 | { |
| 1299 | id->k[0] = SECP256K1_TAG_PUBKEY_EVEN; |
| 1300 | secp256k1_xonly_pubkey_serialize(secp256k1_ctx, |
| 1301 | id->k + 1, |
| 1302 | &point32->pubkey); |
| 1303 | |
| 1304 | /* If we don't find this, let's assume it's odd. */ |
| 1305 | if (!gossmap_find_node(map, id)) |
| 1306 | id->k[0] = SECP256K1_TAG_PUBKEY_ODD; |
| 1307 | } |
no test coverage detected