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

Function update_connection

common/test/run-route-specific.c:62–96  ·  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 const char *shortid,
66 struct amount_msat min,
67 struct amount_msat max,
68 u32 base_fee, s32 proportional_fee,
69 u32 delay,
70 bool disable)
71{
72 struct short_channel_id scid;
73 secp256k1_ecdsa_signature dummy_sig;
74 u8 *msg;
75
76 /* So valgrind doesn't complain */
77 memset(&dummy_sig, 0, sizeof(dummy_sig));
78
79 if (!short_channel_id_from_str(shortid, strlen(shortid), &scid))
80 abort();
81
82 msg = towire_channel_update(tmpctx,
83 &dummy_sig,
84 &chainparams->genesis_blockhash,
85 &scid, 0,
86 ROUTING_OPT_HTLC_MAX_MSAT,
87 node_id_idx(from, to)
88 + (disable ? ROUTING_FLAGS_DISABLED : 0),
89 delay,
90 min,
91 base_fee,
92 proportional_fee,
93 max);
94
95 write_to_store(store_fd, msg);
96}
97
98static void add_connection(int store_fd,
99 const struct node_id *from,

Callers 2

add_connectionFunction · 0.70
mainFunction · 0.70

Calls 4

abortFunction · 0.85
node_id_idxFunction · 0.85
write_to_storeFunction · 0.70

Tested by

no test coverage detected