rgb-cln/lightningd
Rusty Russell 3543530172 build_utxos: fix weight calculation, and make more accurate.
Accuracy improvements:

1. We assumed the output was a p2wpkh, but it can be user-supplied now.
2. We assumed we always had change; remove this for wallet_select_all.

Calculation out-by-one fixes:

1. We need to add 1 byte (4 sipa) for the input count.
2. We need to add 1 byte (4 sipa) for the output count.
3. We need to add 1 byte (4 sipa) for the output script length for each output.
4. We need to add 1 byte (4 sipa) for the input script length for each input.
5. We need to add 1 byte (4 sipa) for the PUSH optcode for each P2SH input.

The results are now a slight overestimate (due to guessing 73 bytes
for signature, whereas they're 71 or 72 in practice).

Fixes: #458
Reported-by: Jonas Nick @jonasnick
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-12-20 12:56:15 +01:00
..
test Re-enable builds with DEVELOPER=0 2017-12-20 12:43:10 +01:00
.gitignore handshaked: remove. 2017-10-20 18:31:32 +02:00
Makefile lightningd: tal memleak detection, dev-memleak command. 2017-12-20 12:43:10 +01:00
bitcoind.c lightningd: add notleak annotations. 2017-12-20 12:43:10 +01:00
bitcoind.h feerate: use u32 everywhere. 2017-11-23 12:40:32 +01:00
build_utxos.c build_utxos: fix weight calculation, and make more accurate. 2017-12-20 12:56:15 +01:00
build_utxos.h build_utxos: fix weight calculation, and make more accurate. 2017-12-20 12:56:15 +01:00
chaintopology.c lightningd: add notleak annotations. 2017-12-20 12:43:10 +01:00
chaintopology.h lightningd: tal memleak detection, dev-memleak command. 2017-12-20 12:43:10 +01:00
dev_ping.c jsonrpc: make explicit call to indicate cmd is still pending. 2017-12-20 12:43:10 +01:00
gossip_control.c jsonrpc: make explicit call to indicate cmd is still pending. 2017-12-20 12:43:10 +01:00
gossip_control.h gossipd: rewrite to do the handshake internally. 2017-10-20 18:31:32 +02:00
gossip_msg.c ipaddr: rename to wireaddr. 2017-10-26 21:01:09 +00:00
gossip_msg.h ipaddr: rename to wireaddr. 2017-10-26 21:01:09 +00:00
hsm_control.c hsm: Cleanup after merging control and client libraries 2017-12-03 17:06:13 +01:00
hsm_control.h lightningd/hsm_control: use a simple fd for HSM. 2017-06-27 10:25:53 +09:30
htlc_end.c pay: close leaks. 2017-12-20 12:43:10 +01:00
htlc_end.h pay: close leaks. 2017-12-20 12:43:10 +01:00
invoice.c invoice: remove strange code. 2017-12-20 12:43:10 +01:00
invoice.h invoice: move link to the top of the structure. 2017-12-20 12:43:10 +01:00
jsonrpc.c jsonrpc: current pending commands are not a leak. 2017-12-20 12:43:10 +01:00
jsonrpc.h jsonrpc: make explicit call to indicate cmd is still pending. 2017-12-20 12:43:10 +01:00
lightningd.c lightningd: require explicit LIGHTNINGD_DEV_MEMLEAK env var to do memleak. 2017-12-20 12:43:10 +01:00
lightningd.h lightningd: use env var not cmdline to suppress backtrace. 2017-12-20 12:43:10 +01:00
log.c log: mark ltmp as notleak. 2017-12-20 12:43:10 +01:00
log.h memleak: add backtrace to allocations. 2017-12-20 12:43:10 +01:00
memdump.c lightningd: require explicit LIGHTNINGD_DEV_MEMLEAK env var to do memleak. 2017-12-20 12:43:10 +01:00
netaddress.c type_to_string: format wireaddr. 2017-10-26 21:01:09 +00:00
netaddress.h ipaddr: rename to wireaddr. 2017-10-26 21:01:09 +00:00
opt_time.c common: absorb remaining files from daemon/ 2017-08-29 17:54:14 +02:00
opt_time.h headers: fix up header idempotent lines. 2017-08-29 17:54:14 +02:00
options.c lightningd: use env var not cmdline to suppress backtrace. 2017-12-20 12:43:10 +01:00
options.h ipaddr: rename to wireaddr. 2017-10-26 21:01:09 +00:00
pay.c pay: close leaks. 2017-12-20 12:43:10 +01:00
pay.h lightningd: unify pay vs forward path when handling failures. 2017-06-23 09:29:42 +09:30
peer_control.c build_utxos: fix weight calculation, and make more accurate. 2017-12-20 12:56:15 +01:00
peer_control.h peer_control: move link to the top of the structure. 2017-12-20 12:43:10 +01:00
peer_htlcs.c lightningd: free failed output htlcs. 2017-12-20 12:43:10 +01:00
peer_htlcs.h htlc: Defer saving the outgoing payment until we store the HTLC 2017-11-23 23:45:28 +00:00
peer_state.h gossipd: rewrite to do the handshake internally. 2017-10-20 18:31:32 +02:00
subd.c subd: if a required daemon exits, wait instead of killing it. 2017-12-17 02:44:20 +00:00
subd.h subd: wrap all message callbacks in a transaction. 2017-11-06 10:24:34 +01:00
txfilter.c fixup! txfilter: Add a simple transaction filter 2017-11-29 14:39:12 +01:00
txfilter.h fixup! txfilter: Add a simple transaction filter 2017-11-29 14:39:12 +01:00
watch.c watch: remove peer_debug helper. 2017-09-28 13:07:05 +09:30
watch.h lightningd: remove lightningd_state. 2017-08-29 17:54:14 +02:00