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

Function count_inflights

wallet/test/run-wallet.c:1532–1546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1530}
1531
1532static int count_inflights(struct wallet *w, u64 channel_dbid)
1533{
1534 struct db_stmt *stmt;
1535 int count;
1536 stmt = db_prepare_v2(w->db, SQL("SELECT COUNT(1)"
1537 " FROM channel_funding_inflights"
1538 " WHERE channel_id = ?;"));
1539 db_bind_u64(stmt, 0, channel_dbid);
1540 db_query_prepared(stmt);
1541 if (!db_step(stmt))
1542 abort();
1543 count = db_col_int(stmt, "COUNT(1)");
1544 tal_free(stmt);
1545 return count;
1546}
1547
1548static bool test_channel_inflight_crud(struct lightningd *ld, const tal_t *ctx)
1549{

Callers 1

Calls 6

db_bind_u64Function · 0.85
db_query_preparedFunction · 0.85
db_stepFunction · 0.85
abortFunction · 0.85
db_col_intFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected