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

Function find_account

plugins/bkpr/recorder.c:1125–1157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1123}
1124
1125struct account *find_account(const tal_t *ctx,
1126 struct db *db,
1127 const char *name)
1128{
1129 struct db_stmt *stmt;
1130 struct account *a;
1131
1132 stmt = db_prepare_v2(db, SQL("SELECT"
1133 " id"
1134 ", name"
1135 ", peer_id"
1136 ", opened_event_id"
1137 ", closed_event_id"
1138 ", onchain_resolved_block"
1139 ", is_wallet"
1140 ", we_opened"
1141 ", leased"
1142 ", closed_count"
1143 " FROM accounts"
1144 " WHERE name = ?"));
1145
1146 db_bind_text(stmt, 0, name);
1147 db_query_prepared(stmt);
1148
1149 if (db_step(stmt))
1150 a = stmt2account(ctx, stmt);
1151 else
1152 a = NULL;
1153
1154 tal_free(stmt);
1155
1156 return a;
1157}
1158
1159struct onchain_fee **account_onchain_fees(const tal_t *ctx,
1160 struct db *db,

Callers 9

find_close_accountFunction · 0.85
is_closed_channel_txidFunction · 0.85
json_inspectFunction · 0.85
json_list_account_eventsFunction · 0.85
do_account_close_checksFunction · 0.85
json_balance_snapshotFunction · 0.85
parse_and_log_chain_moveFunction · 0.85
test_account_crudFunction · 0.85

Calls 5

db_bind_textFunction · 0.85
db_query_preparedFunction · 0.85
db_stepFunction · 0.85
stmt2accountFunction · 0.85
tal_freeFunction · 0.85

Tested by 1

test_account_crudFunction · 0.68