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

Function account_get_chain_events

plugins/bkpr/recorder.c:183–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183struct chain_event **account_get_chain_events(const tal_t *ctx,
184 struct db *db,
185 struct account *acct)
186{
187 struct db_stmt *stmt;
188
189 stmt = db_prepare_v2(db, SQL("SELECT"
190 " e.id"
191 ", e.account_id"
192 ", a.name"
193 ", e.origin"
194 ", e.tag"
195 ", e.credit"
196 ", e.debit"
197 ", e.output_value"
198 ", e.currency"
199 ", e.timestamp"
200 ", e.blockheight"
201 ", e.utxo_txid"
202 ", e.outnum"
203 ", e.spending_txid"
204 ", e.payment_id"
205 ", e.ignored"
206 ", e.stealable"
207 ", e.ev_desc"
208 " FROM chain_events e"
209 " LEFT OUTER JOIN accounts a"
210 " ON e.account_id = a.id"
211 " WHERE e.account_id = ?"
212 " ORDER BY e.timestamp, e.id"));
213
214 db_bind_int(stmt, 0, acct->db_id);
215 return find_chain_events(ctx, take(stmt));
216}
217
218static struct chain_event **find_txos_for_tx(const tal_t *ctx,
219 struct db *db,

Callers 2

json_list_account_eventsFunction · 0.85
test_chain_event_crudFunction · 0.85

Calls 2

db_bind_intFunction · 0.85
find_chain_eventsFunction · 0.85

Tested by 1

test_chain_event_crudFunction · 0.68