mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-07 16:14:26 +01:00
gossmap: move gossmap_guess_node_id to pay plugin.
This removes a point32 dependency. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
20
plugins/pay_point32.c
Normal file
20
plugins/pay_point32.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <bitcoin/pubkey.h>
|
||||
#include <common/gossmap.h>
|
||||
#include <common/node_id.h>
|
||||
#include <plugins/pay_point32.h>
|
||||
|
||||
/* There are two 33-byte pubkeys possible: choose the one which appears
|
||||
* in the graph (otherwise payment will fail anyway). */
|
||||
void gossmap_guess_node_id(const struct gossmap *map,
|
||||
const struct point32 *point32,
|
||||
struct node_id *id)
|
||||
{
|
||||
struct pubkey pk;
|
||||
pk.pubkey = point32->pubkey;
|
||||
node_id_from_pubkey(id, &pk);
|
||||
|
||||
/* If we don't find this, let's assume it's the alternate. */
|
||||
if (!gossmap_find_node(map, id))
|
||||
id->k[0] |= 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user