core-lightning/lightningd
Rusty Russell 2022e4a7a9 wallet: simplify payments lookup so sqlite3 uses index.
Filtering by status is rare, so we can do it in the caller; just let sqlite3
filter by payment_hash.

With ~650,000 payments in db:

Before:
```
129/300000 complete 5.60/sec (33078 invs, 169 pays, 0 retries) in 30 seconds. 19 hours-14 hours remaining.
201/300000 complete 7.20/sec (43519 invs, 241 pays, 0 retries) in 40 seconds. 16 hours-11 hours remaining.
257/300000 complete 5.60/sec (54568 invs, 289 pays, 0 retries) in 50 seconds. 16 hours-14 hours remaining.
305/300000 complete 4.80/sec (65772 invs, 337 pays, 0 retries) in 60 seconds. 16 hours-17 hours remaining.
361/300000 complete 5.60/sec (75875 invs, 401 pays, 0 retries) in 70 seconds. 16 hours-14 hours remaining.
```

After:
```
760/300000 complete 40.00/sec (19955 invs, 824 pays, 0 retries) in 20 seconds. 2 hours-2 hours remaining.
1176/300000 complete 41.60/sec (30082 invs, 1224 pays, 0 retries) in 30 seconds. 2 hours-119 minutes remaining.
1584/300000 complete 40.80/sec (40224 invs, 1640 pays, 0 retries) in 40 seconds. 2 hours-2 hours remaining.
1984/300000 complete 40.00/sec (49938 invs, 2048 pays, 0 retries) in 50 seconds. 2 hours-2 hours remaining.
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-09-22 15:19:46 +02:00
..
test jsonrpc: make error codes an enum. 2022-09-19 10:18:55 +09:30
.gitignore Ignore all the deamon inside the git history 2021-10-28 15:51:38 +02:00
bitcoind.c lightningd: trace JSON id prefixes through sendrawtx. 2022-09-16 12:31:45 +09:30
bitcoind.h lightningd: trace JSON id prefixes through sendrawtx. 2022-09-16 12:31:45 +09:30
chaintopology.c Don't report redundant feerates to subdaemons 2022-09-19 19:10:35 +02:00
chaintopology.h lightningd: trace JSON id prefixes through sendrawtx. 2022-09-16 12:31:45 +09:30
channel_control.c doc: update BOLTs to bc86304b4b0af5fd5ce9d24f74e2ebbceb7e2730 2022-09-12 09:34:52 +09:30
channel_control.h doc: update BOLTs to bc86304b4b0af5fd5ce9d24f74e2ebbceb7e2730 2022-09-12 09:34:52 +09:30
channel_state.h channel-state: add two new states, for dualopend 2021-01-10 13:44:04 +01:00
channel.c lightningd: trace JSON id prefixes through sendrawtx. 2022-09-16 12:31:45 +09:30
channel.h notif: dont send balance snapshot for not yet opened channel 2022-09-14 15:59:37 +09:30
closing_control.c lightningd: trace JSON id prefixes through sendrawtx. 2022-09-16 12:31:45 +09:30
closing_control.h lightningd: trace JSON id prefixes through sendrawtx. 2022-09-16 12:31:45 +09:30
coin_mvts.c notif: dont send balance snapshot for not yet opened channel 2022-09-14 15:59:37 +09:30
coin_mvts.h coin_mvt: tiny, dont import lightningd header 2022-02-07 13:02:09 +10:30
connect_control.c jsonrpc: make error codes an enum. 2022-09-19 10:18:55 +09:30
connect_control.h plugin: wire JSON id for commands which caused hooks to fire. 2022-09-16 12:31:45 +09:30
datastore.c common: clean up json routine locations. 2022-07-15 12:24:00 -05:00
dual_open_control.c plugin: wire JSON id for commands which caused hooks to fire. 2022-09-16 12:31:45 +09:30
dual_open_control.h lightningd: hand fds to connectd, not receive them from connectd. 2022-07-18 20:50:04 -05:00
feerate.c lightningd/json.h: remove. 2022-07-15 12:24:00 -05:00
feerate.h lightningd/json.h: remove. 2022-07-15 12:24:00 -05:00
gossip_control.c gossipd: rename remote_addr to discovered_ip within gossipd 2022-09-15 13:30:06 +09:30
gossip_control.h connectd: remove second gossip fd. 2022-02-08 11:15:52 +10:30
hsm_control.c lightningd: expand exit codes for various failures. 2022-07-20 19:28:33 +09:30
hsm_control.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
htlc_end.c lightningd: fix overzealous check in htlc_out_check: 2022-04-20 16:30:05 +09:30
htlc_end.h coin_mvt: record fees for an outbound htlc 2021-12-28 04:42:42 +10:30
htlc_set.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
htlc_set.h Makefile: use completely separate spec-derived files for EXPERIMENTAL_FEATURES 2020-09-08 09:42:00 +09:30
invoice.c lightningd: deprecated "delexpiredinvoice", put functionality in autoclean plugin. 2022-09-22 15:19:46 +02:00
invoice.h Makefile: use completely separate spec-derived files for EXPERIMENTAL_FEATURES 2020-09-08 09:42:00 +09:30
io_loop_with_timers.c database: pull out database code into a new module 2022-03-05 15:03:34 +10:30
io_loop_with_timers.h lightningd/io_loop_with_timers.c: Move mainloop to its own source file, have chaintopology use it. 2019-05-31 17:57:10 +02:00
jsonrpc.c memleak: simplify API. 2022-09-19 11:34:42 +09:30
jsonrpc.h jsonrpc: make error codes an enum. 2022-09-19 10:18:55 +09:30
lightningd.c memleak: simplify API. 2022-09-19 11:34:42 +09:30
lightningd.h opening: Add dev-allowdustreserve option to opt into dust reserves 2022-09-21 11:25:47 +02:00
log_status.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
log_status.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
log.c lightningd: fix fatal() log message in log. 2022-07-25 08:11:09 -07:00
log.h options: let log-level subsystem filter also cover nodeid. 2022-07-09 09:59:52 +09:30
Makefile lightningd/json.h: remove. 2022-07-15 12:24:00 -05:00
memdump.c memleak: remove exclusions from memleak_start() 2022-09-19 11:34:42 +09:30
memdump.h lightningd: simplify memleak code. 2022-03-10 09:40:09 +10:30
notification.c jsonrpc: make error codes an enum. 2022-09-19 10:18:55 +09:30
notification.h jsonrpc: make error codes an enum. 2022-09-19 10:18:55 +09:30
offer.c wallet: simplify payments lookup so sqlite3 uses index. 2022-09-22 15:19:46 +02:00
onchain_control.c lightningd: trace JSON id prefixes through sendrawtx. 2022-09-16 12:31:45 +09:30
onchain_control.h onchaind: remove 'is_replay' logic 2021-12-28 04:42:42 +10:30
onion_message.c plugin: wire JSON id for commands which caused hooks to fire. 2022-09-16 12:31:45 +09:30
onion_message.h common: remove support for pre v0.10.2 onionmessages. 2021-12-01 05:44:28 +10:30
opening_common.c openingd: Add reserve to fundchannel and multifundchannel 2022-09-21 11:25:47 +02:00
opening_common.h openingd: Add reserve to fundchannel and multifundchannel 2022-09-21 11:25:47 +02:00
opening_control.c opening: Add dev-allowdustreserve option to opt into dust reserves 2022-09-21 11:25:47 +02:00
opening_control.h connectd: hold peer until we're interested. 2022-03-23 13:20:12 +10:30
options.c lightningd: allow extra tlv types in non-experimental mode. 2022-09-22 17:19:11 +09:30
options.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
pay.c wallet: simplify payments lookup so sqlite3 uses index. 2022-09-22 15:19:46 +02:00
pay.h jsonrpc: make error codes an enum. 2022-09-19 10:18:55 +09:30
peer_control.c plugin: wire JSON id for commands which caused hooks to fire. 2022-09-16 12:31:45 +09:30
peer_control.h connectd: control connect backoff from lightningd. 2022-07-28 15:08:44 +09:30
peer_fd.c subdaemons: remove gossipd fd from per-peer daemons. 2022-02-08 11:15:52 +10:30
peer_fd.h subdaemons: remove gossipd fd from per-peer daemons. 2022-02-08 11:15:52 +10:30
peer_htlcs.c plugin: wire JSON id for commands which caused hooks to fire. 2022-09-16 12:31:45 +09:30
peer_htlcs.h lightningd: extra sanity checks and rescue attempts for missing HTLCs. 2022-03-31 13:40:27 +10:30
ping.c common: clean up json routine locations. 2022-07-15 12:24:00 -05:00
plugin_control.c lightningd: wire plugin command JSON id through to plugin commands. 2022-09-16 12:31:45 +09:30
plugin_control.h plugins: add command field to subcommand output. 2021-06-25 09:49:33 +09:30
plugin_hook.c plugin: wire JSON id for commands which caused hooks to fire. 2022-09-16 12:31:45 +09:30
plugin_hook.h plugin: wire JSON id for commands which caused hooks to fire. 2022-09-16 12:31:45 +09:30
plugin.c memleak: simplify API. 2022-09-19 11:34:42 +09:30
plugin.h lightningd: wire plugin command JSON id through to plugin commands. 2022-09-16 12:31:45 +09:30
routehint.c lightnind: use aliases in routehints for private channels. 2022-08-09 16:31:36 -05:00
routehint.h invoice: overhaul routehints to use topology.listincoming, cleanup. 2021-06-16 10:29:17 +09:30
signmessage.c lightningd: use jcon logging for commands where possible. 2022-09-16 12:31:45 +09:30
subd.c lightningd: more graceful shutdown. 2022-09-12 14:00:41 +02:00
subd.h lightningd: more graceful shutdown. 2022-09-12 14:00:41 +02:00
watch.c Remove names of parameters of callbacks which confuse gcc. 2022-08-31 12:18:28 +03:00
watch.h Remove names of parameters of callbacks which confuse gcc. 2022-08-31 12:18:28 +03:00