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

Function update_connection

common/test/run-route.c:62–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62static void update_connection(int store_fd,
63 const struct node_id *from,
64 const struct node_id *to,
65 u32 base_fee, s32 proportional_fee,
66 u32 delay,
67 bool disable)
68{
69 struct short_channel_id scid;
70 secp256k1_ecdsa_signature dummy_sig;
71 u8 *msg;
72
73 /* So valgrind doesn't complain */
74 memset(&dummy_sig, 0, sizeof(dummy_sig));
75
76 /* Make a unique scid. */
77 memcpy(&scid, from, sizeof(scid) / 2);
78 memcpy((char *)&scid + sizeof(scid) / 2, to, sizeof(scid) / 2);
79
80 msg = towire_channel_update(tmpctx,
81 &dummy_sig,
82 &chainparams->genesis_blockhash,
83 scid, 0,
84 ROUTING_OPT_HTLC_MAX_MSAT,
85 node_id_idx(from, to)
86 + (disable ? ROUTING_FLAGS_DISABLED : 0),
87 delay,
88 AMOUNT_MSAT(0),
89 base_fee,
90 proportional_fee,
91 AMOUNT_MSAT(100000 * 1000));
92
93 write_to_store(store_fd, msg);
94}
95
96static void add_connection(int store_fd,
97 const struct node_id *from,

Callers 2

add_connectionFunction · 0.70
mainFunction · 0.70

Calls 2

node_id_idxFunction · 0.85
write_to_storeFunction · 0.70

Tested by

no test coverage detected