Commit graph

236 commits

Author SHA1 Message Date
Antoine Riard
890d1768b7 Add test_dynamic_spendable_outputs_local_htlc_*
Cover both local HTLC-Timeout/Success case
2018-11-19 20:51:17 -05:00
Antoine Riard
b6b5decfa9 Add test_static_spendable_outputs_justice_tx_revoked_htlc*
Cover both HTLC-Timeout/Success cases
2018-11-19 20:42:55 -05:00
Antoine Riard
73415a8951 Add test_static_spendable_outputs_justice_tx_revoked_commitment_tx 2018-11-19 20:42:55 -05:00
Antoine Riard
e22220d79f Add test_claim_on_remote_sizeable_push_msat
Contrary to sizeable push_msat on local
commitment tx, the output go to a P2WPKH
2018-11-19 20:42:52 -05:00
Antoine Riard
3518f1f85d Add test_static_spendable_outputs_preimage_tx
Aims to covered both keysinterace preimage tx case and
detection of second remote commitment tx

Split DynamicDescriptor between *P2WSH and *P2WKH
2018-11-19 20:39:38 -05:00
Antoine Riard
f053169363 Add test_claim_sizeable_push_msat
Aims to cover both claiming of sizeable_push_msat and
spendable output generation for to_local output
2018-11-15 19:08:27 -05:00
Steven Roose
7ff7561f2d Update to rust-bitcoin v0.15 2018-11-14 11:43:54 +00:00
Matt Corallo
3c44d6beca
Merge pull request #248 from TheBlueMatt/2018-11-monitor-test-split
Split up channel_monitor_network_test a little bit
2018-11-14 09:20:54 +10:30
Matt Corallo
44f56f84b6 Split up channel_monitor_network_test a little bit 2018-11-09 15:01:53 +10:30
Antoine Riard
fa2ac8cd84 Add test justice tx on revoked htlc_success
Extend channel_monitor_network_test to cover
all check_spend_remote_htlc cases
2018-11-08 02:21:28 +00:00
Yuntai Kyong
05b580e10b fail channel when BADONION is not set. 2018-11-05 21:10:17 +09:00
Matt Corallo
0e098d4bab
Merge pull request #241 from TheBlueMatt/2018-10-peer-free-panic
Fix pre-noise outbound peer disconnect panic found by fuzzer
2018-11-02 23:59:59 -04:00
Matt Corallo
182affc03b Test the various shutdown handling updates 2018-11-02 22:26:51 -04:00
Matt Corallo
224fb05cc5 Rebroadcast shutdown on channel_reestablish (and reprocess them) 2018-11-02 22:26:51 -04:00
Matt Corallo
78232f2aed Fail incoming HTLCs sent after we start shutdown, not the chan 2018-11-02 22:26:51 -04:00
Matt Corallo
b030e84ad8 Add logging for (dis)connect in peer_handler/channelmanager 2018-11-02 10:45:29 -04:00
Matt Corallo
a11e27d20e Send closing_signed when appropriate as pending HTLCs clear 2018-11-01 17:08:53 -04:00
Matt Corallo
4eb8a4905c Use ChannelError in shutdown handling, clean up, impl err actions 2018-11-01 13:50:03 -04:00
Matt Corallo
11776dbb63 Add warnings reminding users to use SegWit funding inputs 2018-11-01 13:50:03 -04:00
Schalk van Heerden
a0be4d1758 Added config interface to allow users to specify channel limits 2018-10-31 15:45:30 -04:00
Matt Corallo
9189d0e61d Require at least 1k sat for outbound channels and meet BTC's dust 2018-10-31 15:45:30 -04:00
Matt Corallo
64bd2eaa7f Give ManyChannelMonitor a logger and trace add_update events 2018-10-29 14:26:05 -04:00
Matt Corallo
6ed5a829bb Fix + test disconnect/reconnect prior to FundingLocked 2018-10-27 09:58:10 -04:00
Matt Corallo
7f91572e2e Add very basic test of ChannelManager serialization round-trip 2018-10-27 09:58:10 -04:00
Matt Corallo
a2fb3ccc08 Implement and document Channel/ChannelManager (de)serialization 2018-10-27 09:58:10 -04:00
Matt Corallo
74cec623fd Add a BIG lock to ChannelManager
During normal operation we should never need to take this, so we
use a RwLock that allows normal parallelism until we want to
serialize out our ChannelManager, at which point we can take the
write-mode lock.
2018-10-27 09:42:04 -04:00
Matt Corallo
bb43b98e8f Store [u8; 32]s instead of SharedSecrets (for deserialization) 2018-10-27 09:42:04 -04:00
Matt Corallo
c0c139cdc2 Fix and test update_add_htlc but disconnect pre-commitment_signed 2018-10-27 09:42:04 -04:00
Matt Corallo
249aa77550 Send channel_reestablish out-of-band to ensure ordered deliver 2018-10-27 09:42:04 -04:00
Matt Corallo
e2de49ddc4 Respond to channel_reestablish out-of-band for ordered delivery 2018-10-27 09:42:04 -04:00
Matt Corallo
4342114345 Send RAA/CS messages out-of-band to ensure ordered delivery 2018-10-27 09:42:04 -04:00
Matt Corallo
812f255d7c Send shutdown/closing_signed msgs out-of-band for ordered delivery 2018-10-27 09:42:04 -04:00
Matt Corallo
e382a7b4b3 Send announcement_signatures msgs out-of-band for ordered delivery 2018-10-27 09:42:04 -04:00
Matt Corallo
c962a27156 Send funding_signed messages out-of-band to ensure ordered delivery 2018-10-27 09:42:04 -04:00
Matt Corallo
608d517f92 Send AcceptChannel responses out-of-band to ensure ordered delivery 2018-10-27 09:42:04 -04:00
Matt Corallo
e397cb9960 Split Event, move MessageSendEvent push() inside channel_state lock 2018-10-27 09:42:04 -04:00
Antoine Riard
e361fed0f1 Integrate KeysInterface to ChannelManager with Arc 2018-10-27 09:42:04 -04:00
Antoine Riard
d33cb3cca5 Add a KeysInterface which provides keys from user
Move ChannelKeys into keysinterface for generate a set of it from
master_seed and change return type to panic on bogus data
2018-10-27 09:34:45 -04:00
Yuntai Kyong
f133554697 Add PaymentFailReason for fail_htlc_backwards
to indicate fail reason after a PaymentReceived event
2018-10-25 21:24:53 +09:00
Matt Corallo
497643a65b Add basic sanity testing for channel monitor update failure handle 2018-10-23 16:03:30 -04:00
Matt Corallo
267b9a44df ChannelManager support for monitor update failure in one place 2018-10-23 16:03:30 -04:00
Matt Corallo
4cca933288 Pull out the HTLC forwarding loop into a function 2018-10-23 16:03:30 -04:00
Matt Corallo
bd2c839a73 Move channel monitor updates inside the channel_state lock
This really, really sucks as it defeats almost all of the
cross-channel parallelism we'd intended to have - waiting on a
client to update a watchtower for an unrelated channel to process
any messages is really shitty. We should revisit this with
per-channel locks as a compile-time option post-0.1.
2018-10-23 16:03:30 -04:00
Matt Corallo
13b80ce805 Add test for two-updates-in-flight disconnect channel resumption 2018-10-23 15:26:11 -04:00
Matt Corallo
e86c84b2be Add message ordering return value to handling channel_reestablish 2018-10-23 15:26:11 -04:00
Yuntai Kyong
920d1458c4 Move HTLCFailChannelUpdate handling out-of-band
While this isn't neccessary for message ordering consistency, this
does mean that we won't end up processing an HTLCFailChannelUpdate
from a update_fail_htlc prior to it being fully committed (where if
the peer disconnects/reconnects it could theoretically give us a
different result, eg if their next-hop reconnected to them).
2018-10-23 14:01:21 -04:00
Yuntai Kyong
dc61c98773 Partially implement more onion error handling for sent payments
Also refactor out onion error handling into a function instead of
in update_fail_htlc.

Cache the initial htlc_msat that we sent instead of recalculating
it to check validity of the error returned.
2018-10-23 13:54:57 -04:00
Yuntai Kyong
ed30a199e3 Error handling in decoding onion 2018-10-23 10:44:40 -04:00
Yuntai Kyong
ba30061c87 Add is_permanent field to ChannelClosed message and add NodeFailure
message
2018-10-23 10:30:49 -04:00
Matt Corallo
d318184c9e Avoid needless on-chain channel failing for timing-out HTLCs
See new comments in code for more details
2018-10-22 11:49:57 -04:00