core-lightning/tests
Rusty Russell d9b1e69243 dual_funding: don't steal inflight field in update_channel_from_inflight.
If we call update_channel_from_inflight *twice* with the same inflight, we
will get bad results.  Using tal_steal() here was a premature optimization:

```
Valgrind error file: valgrind-errors.496395
==496395== Invalid read of size 8
==496395==    at 0x22A9D3: to_tal_hdr (tal.c:174)
==496395==    by 0x22B4B5: tal_steal_ (tal.c:498)
==496395==    by 0x16A13D: update_channel_from_inflight (peer_control.c:1225)
==496395==    by 0x16A4C7: funding_depth_cb (peer_control.c:1299)
==496395==    by 0x182807: txw_fire (watch.c:232)
==496395==    by 0x182AA9: watch_topology_changed (watch.c:300)
==496395==    by 0x1290ED: updates_complete (chaintopology.c:624)
==496395==    by 0x129BF4: get_new_block (chaintopology.c:835)
==496395==    by 0x125EEF: getrawblockbyheight_callback (bitcoind.c:362)
==496395==    by 0x176ECC: plugin_response_handle (plugin.c:584)
==496395==    by 0x1770F5: plugin_read_json_one (plugin.c:690)
==496395==    by 0x1772D9: plugin_read_json (plugin.c:735)
==496395==  Address 0x89fbb08 is 24 bytes inside a block of size 104 free'd
==496395==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==496395==    by 0x22B193: del_tree (tal.c:421)
==496395==    by 0x22B461: tal_free (tal.c:486)
==496395==    by 0x16A123: update_channel_from_inflight (peer_control.c:1223)
==496395==    by 0x16A4C7: funding_depth_cb (peer_control.c:1299)
==496395==    by 0x182807: txw_fire (watch.c:232)
==496395==    by 0x182AA9: watch_topology_changed (watch.c:300)
==496395==    by 0x1290ED: updates_complete (chaintopology.c:624)
==496395==    by 0x129BF4: get_new_block (chaintopology.c:835)
==496395==    by 0x125EEF: getrawblockbyheight_callback (bitcoind.c:362)
==496395==    by 0x176ECC: plugin_response_handle (plugin.c:584)
==496395==    by 0x1770F5: plugin_read_json_one (plugin.c:690)
==496395==  Block was alloc'd at
==496395==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==496395==    by 0x22AC1C: allocate (tal.c:250)
==496395==    by 0x22B1DD: tal_alloc_ (tal.c:428)
==496395==    by 0x22B3A6: tal_alloc_arr_ (tal.c:471)
==496395==    by 0x22C094: tal_dup_ (tal.c:805)
==496395==    by 0x12B274: new_inflight (channel.c:187)
==496395==    by 0x136D4C: wallet_commit_channel (dual_open_control.c:1260)
==496395==    by 0x13B084: handle_commit_received (dual_open_control.c:2839)
==496395==    by 0x13B6AF: dual_opend_msg (dual_open_control.c:2976)
==496395==    by 0x1809FF: sd_msg_read (subd.c:553)
==496395==    by 0x218F5D: next_plan (io.c:59)
==496395==    by 0x219B65: do_plan (io.c:407)
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-02-08 11:15:52 +10:30
..
data inflights: save the whole psbt to the database 2021-05-24 12:17:48 +09:30
fuzz check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
plugins balance-snaps: add a balance_snapshot event; fires after first catchup 2021-12-28 04:42:42 +10:30
vectors pytest: Add tests for the sphinx onion generation and processing 2020-03-12 10:25:01 +10:30
benchmark.py pytest: always provide payment_secret when making payments. 2021-07-14 14:38:00 -05:00
conftest.py tests: add marker for v1/v2 channel opens 2021-05-12 11:25:41 +09:30
db.py pytest: don't copy db to query it. 2021-08-26 12:44:02 +09:30
fixtures.py pytest: add schema support for JSON responses. 2021-05-27 20:28:49 +09:30
test_closing.py dual_funding: don't steal inflight field in update_channel_from_inflight. 2022-02-08 11:15:52 +10:30
test_connection.py pytest: protect against bad gossip messages from mining confirms too fast. 2022-02-08 11:15:52 +10:30
test_db.py wallet/db_sqlite3.c: Support direct replication of SQLITE3 backends. 2021-11-17 12:10:07 +10:30
test_gossip.py pytest: protect against bad gossip messages from mining confirms too fast. 2022-02-08 11:15:52 +10:30
test_invoices.py pytest: protect against bad gossip messages from mining confirms too fast. 2022-02-08 11:15:52 +10:30
test_misc.py pytest: protect against bad gossip messages from mining confirms too fast. 2022-02-08 11:15:52 +10:30
test_onion.py pytest: Actually make sure that the direcory exists 2020-03-24 09:52:33 +10:30
test_opening.py dev_disconnect: remove @ marker. 2021-12-30 09:50:40 +10:30
test_pay.py pytest: protect against bad gossip messages from mining confirms too fast. 2022-02-08 11:15:52 +10:30
test_plugin.py pytest: protect against bad gossip messages from mining confirms too fast. 2022-02-08 11:15:52 +10:30
test_wallet.py coin moves: notify when we make deposits to external accounts 2022-01-26 13:34:45 +10:30
utils.py pytest: protect against bad gossip messages from mining confirms too fast. 2022-02-08 11:15:52 +10:30