| 7220 | } |
| 7221 | |
| 7222 | struct db_stmt *wallet_chain_moves_first(struct wallet *wallet, |
| 7223 | u64 liststart, |
| 7224 | u32 *listlimit) |
| 7225 | { |
| 7226 | struct db_stmt *stmt = db_prepare_v2(wallet->db, |
| 7227 | SQL("SELECT" |
| 7228 | " chain_moves.id" |
| 7229 | ", account_channel_id" |
| 7230 | ", ma1.name" |
| 7231 | ", tag_bitmap" |
| 7232 | ", credit_or_debit" |
| 7233 | ", timestamp" |
| 7234 | ", utxo" |
| 7235 | ", spending_txid" |
| 7236 | ", peer_id" |
| 7237 | ", payment_hash" |
| 7238 | ", block_height" |
| 7239 | ", output_sat" |
| 7240 | ", originating_channel_id" |
| 7241 | ", ma2.name" |
| 7242 | ", output_count" |
| 7243 | " FROM chain_moves" |
| 7244 | " LEFT JOIN" |
| 7245 | " move_accounts ma1 ON account_nonchannel_id = ma1.id" |
| 7246 | " LEFT JOIN" |
| 7247 | " move_accounts ma2 ON originating_nonchannel_id = ma2.id" |
| 7248 | " WHERE chain_moves.id >= ?" |
| 7249 | " ORDER BY chain_moves.id" |
| 7250 | " LIMIT ?;")); |
| 7251 | db_bind_u64(stmt, liststart); |
| 7252 | if (listlimit) |
| 7253 | db_bind_int(stmt, *listlimit); |
| 7254 | else |
| 7255 | db_bind_int(stmt, INT_MAX); |
| 7256 | db_query_prepared(stmt); |
| 7257 | return wallet_chain_moves_next(wallet, stmt); |
| 7258 | } |
| 7259 | |
| 7260 | struct db_stmt *wallet_chain_moves_next(struct wallet *wallet, struct db_stmt *stmt) |
| 7261 | { |
no test coverage detected