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

Function wallet_channel_load

wallet/test/run-wallet.c:1355–1370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1353}
1354
1355static struct channel *wallet_channel_load(struct wallet *w, const u64 dbid)
1356{
1357 struct peer *peer;
1358 struct channel *channel;
1359
1360 /* We expect only one peer, but reuse same code */
1361 if (!wallet_init_channels(w))
1362 return NULL;
1363 peer = list_top(&w->ld->peers, struct peer, list);
1364 CHECK(peer);
1365
1366 /* We load lots of identical dbid channels: use last one */
1367 channel = list_tail(&peer->channels, struct channel, list);
1368 assert(channel->dbid == dbid);
1369 return channel;
1370}
1371
1372static bool test_channel_crud(struct lightningd *ld, const tal_t *ctx)
1373{

Callers 2

test_channel_crudFunction · 0.85

Calls 1

wallet_init_channelsFunction · 0.50

Tested by

no test coverage detected