core-lightning/tests
Rusty Russell c5cd4791be onchaind: allow multiple candidate HTLCs for output match
When we have multiple HTLCs with the same preimage and the same CLTV,
it doesn't matter what order we treat them (they're literally
identical).  But when we offer HTLCs with the same preimage but
different CLTVs, the commitment tx outputs look identical, but the
HTLC txs are different: if we simply take the first HTLC which matches
(and that's not the right one), the HTLC signature we got from them
won't match.  As we rely on the signature matching to detect the fee
paid, we get:

	onchaind: STATUS_FAIL_INTERNAL_ERROR: grind_fee failed

So we alter match_htlc_output() to return an array of all matching
HTLC indices, which can have more than one entry for offered HTLCs.
If it's our commitment, we loop through until one of the HTLC
signatures matches.  If it's their commitment, we choose the HTLC with
the largest CLTV: we're going to ignore it once that hits anyway, so
this is the most conservative approach.  If it's a penalty, it doesn't
matter since we steal all HTLC outputs the same independent of CLTV.

For accepted HTLCs, the CLTV value is encoded in the witness script,
so this confusion isn't possible.  We nonetheless assert that the
CLTVs all match in that case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-10-23 16:55:35 +02:00
..
benchmark.py benchmark: Add two benchmarks for forwarded payments 2018-10-13 10:58:53 +00:00
btcproxy.py pytest: wait until mock is called for set_feerates. 2018-09-20 09:12:28 +02:00
conftest.py pytest: Pass result to fixtures and keep directories of failed tests 2018-08-07 00:54:19 +00:00
fixtures.py tests: quiet down DeprecationWarnings for escape sequences 2018-10-08 13:18:31 +02:00
requirements.txt python: add cheroot to requirements.txt 2018-10-10 18:00:22 +02:00
test_closing.py onchaind: allow multiple candidate HTLCs for output match 2018-10-23 16:55:35 +02:00
test_connection.py connectd: give user a hint when wrong key is used. 2018-10-19 00:53:00 +00:00
test_gossip.py pytest: make wait_for do exponential backoff, start at 0.25 seconds. 2018-10-10 06:10:42 +00:00
test_invoices.py gossipd: don't expose private channels for routeboost. 2018-10-15 23:04:17 +00:00
test_misc.py spelling: Check LockTime Verify. 2018-10-23 16:55:35 +02:00
test_pay.py channeld: tiebreak identical HTLC outputs by CLTV. 2018-10-23 16:55:35 +02:00
utils.py pytest: Test that we record forwardings correctly 2018-10-19 21:58:27 +00:00