Philip Robinson
1de117eb2a
Explicit tests for update_*_htlc message BOLT2 requirements
2019-02-11 12:09:07 -05:00
Matt Corallo
f99acc6d35
Merge pull request #297 from TheBlueMatt/2019-01-back-fail-privacy
...
Send back the actual received amount, not expected on HTLC fails
2019-01-25 12:01:44 -05:00
Matt Corallo
bf26056c8a
Fix holding cell freeing in case we fail to add some HTLC
...
Previously, if we went to free the holding cell HTLC updates, and
adding one failed as we hit our outbound HTLC limit (or in-flight
value limit), we would not send a commitment_signed, leaving us in
an invalid state. We first fix that bug, and then refuse to add
things to our holding cell once we reach our limits considering the
holding cell, as we shouldn't have multiple commitment dance rounds
worth of HTLCs in the holding cell anyway.
2019-01-24 21:53:49 -05:00
Matt Corallo
74588b2519
Send back the actual received amount, not expected on HTLC fails
...
This resolves an incorrect implementation of the spec and fixes a
major privacy leak.
Fixes GH #289 .
2019-01-24 16:55:01 -05:00
Dimitris Apostolou
ab10b05075
Fix typos
2019-01-24 19:07:08 +02:00
Matt Corallo
d69fb5f58d
Fix indentation in a few new tests
2019-01-23 17:06:38 -05:00
Matt Corallo
aa8ecfed7b
Split up monitor-update-failed tests and other functional tests
2019-01-23 16:54:01 -05:00
Matt Corallo
8d9eb973cc
Split up functional_tests into utils and the tests themselves
2019-01-23 16:46:44 -05:00
Yuko Roodt
4d77e9d752
Added tests to check the bolt 2 specs for Sending Node Channel
2019-01-23 14:54:10 -05:00
Matt Corallo
be8213b244
Fix handling RAA when a monitor update previously failed
2019-01-22 14:38:56 -05:00
Matt Corallo
4cceb58f91
Rewrite monitor_update_failed as it didn't capture all the options
...
Primarily this fixes the case where we receive an RAA which does
not require a response, allowing us to call monitor_update_failed
without generating pending messages.
2019-01-22 14:34:18 -05:00
Matt Corallo
12d25576c1
Upgrade to secp256k1 v12, bitcoin v16, and crates bitcoin_hashes
2019-01-22 13:49:15 -05:00
Matt Corallo
4f4a5c06d2
Fix Router min HTLC comparison
2019-01-22 12:22:40 -05:00
Philip Robinson
a48fb848d9
Wrote test to explicitly test BOLT 2 requirements for update_add_htlc
...
(minor tweaks by @TheBlueMatt)
2019-01-22 12:22:14 -05:00
Matt Corallo
d8707c2b20
Check for timing-out HTLCs in remote unrevoked commitments
...
This resolves a TODO/issue in would_broadcast_at_height where we
will not fail a channel with HTLCs which time out in remote
broadcastable transactions.
2019-01-13 12:59:19 -05:00
Matt Corallo
78939a7e03
Test for failing channel after local commitment dust HTLC timeout
2019-01-13 12:59:19 -05:00
Matt Corallo
c9df4bd011
Fix multi-remote-HTLC-claim preimage learning
...
When our counterparty claims multiple HTLCs from offered outputs in
one transaction we should still be able to learn the preimages.
Sadly, due to two bugs we were not previously doing so.
2019-01-08 22:47:23 -05:00
Matt Corallo
e662fa14af
Fix stale comment in functional_tests after failing back async
2019-01-05 16:26:20 -05:00
Matt Corallo
e344b0a8fe
Add test_commitment_revoked_fail_backward_exhaustive no_to_remote
...
This tests a case we previously didn't handle correctly where we
returned early if there was no to_remote output to claim and thus
failed to fail-backwards HTLCs which were present.
2019-01-05 16:24:50 -05:00
Matt Corallo
dbbf4914ea
Add dust mode to test_commitment_revoked_fail_backward_exhaustive
...
This tests that we fail back HTLCs that don't make it into
commitment transactions the same as we test ones that do.
2019-01-05 16:24:50 -05:00
Antoine Riard
93fd3e8bb9
More comments/hardening test_fail_backwards_unrevoked_remote_announce
2018-12-31 19:56:32 -05:00
Matt Corallo
608cf1c89d
Fail HTLC backwards on unrevoked remote commitment tx broadcast
2018-12-31 19:56:32 -05:00
Matt Corallo
726674ddb5
Macro-out BroadcastChannelUpdate-on-channel-close in func tests
2018-12-22 07:03:17 -05:00
Matt Corallo
044edd6e86
Fail HTLCs backwards asynchronously
2018-12-21 15:17:42 -05:00
Matt Corallo
c220a5c5cf
Add an enum option to pending forwards to fail backwards
2018-12-20 22:56:32 -05:00
Matt Corallo
e5c1716f5c
Refactor HTLCForwardInfo into an enum in prep for delayed-fail
2018-12-20 22:56:32 -05:00
Matt Corallo
4aa814d53c
macro-out a bunch of PendingHTLCsForwardable+forward calls
2018-12-20 22:56:32 -05:00
Matt Corallo
28e2480c6e
Drop needless mut found by rustc 1.22
2018-12-20 14:32:02 -05:00
Matt Corallo
2053edbe53
Move ChannelManager network tests into their own module
2018-12-20 14:32:02 -05:00