Dimitris Apostolou
ab10b05075
Fix typos
2019-01-24 19:07:08 +02: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
7a77c9f1d2
Merge pull request #298 from TheBlueMatt/2019-01-271-cleanup
...
Implement serialize/deserialize for Router
2019-01-23 14:48:13 -05:00
Antoine Riard
c7b8c312ce
Implement serialize/deserialize for Router.
...
Extend route_test to check if serialize/deserialize of
NetworkMap works.
Add PartialEq traits on some Router's structs.
Modify also UnsignedNodeAnnouncement serialization
2019-01-23 11:31:37 -05:00
Antoine Riard
70d06b4610
Implement Writeable/Readable for Option<T>
...
Add OptionalField in OpenChannel, AcceptChannel
ChannelReestablish to avoid serialization implementation
conflicts
2019-01-23 11:31:26 -05:00
Matt Corallo
8678bda576
Ensure Message always unwraps in fuzztarget
...
Hashes cant be all-0s, so we can normally unwrap, but fuzztarget
can generate all-0 hashes, so we have to handle it and swap for
something else.
2019-01-22 13:49:15 -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
d2ae344799
Fix dead_code warnings in fuzztarget builds
2019-01-08 14:04:06 -05:00
Matt Corallo
7ea39a13b2
Use bitcoin_hashes' fixed_time_eq, removing the rust-crypto dep
2018-12-19 20:02:36 -05:00
Matt Corallo
202c0aedcb
Drop rust-crypto trait usage
2018-12-19 20:02:36 -05:00
Matt Corallo
7511a82195
Steal rust-crypto's Poly1305 implementation wholesale
2018-12-19 20:02:36 -05:00
Matt Corallo
09c7f2f641
Steal rust-crypto's ChaCha20 implementation wholesale
2018-12-19 20:02:36 -05:00
Matt Corallo
f1e400f142
Switch Sha256 to using bitcoin_hashes and our own HKDF
2018-12-19 17:13:25 -05:00
Matt Corallo
caeff85368
Update incorrect_payment_amount generation/handling for BOLT uptd
...
ie dont generate them as they're a really obvious privacy leak.
Luckily we were already handling them the same aside from log
printing so don't have to touch anything there. I was lazy in
updating tests but it only effects log printing, so whatever.
2018-12-17 22:57:47 -05:00
Matt Corallo
8783a748bb
Add test_util for overriding session privs for onion crypt
2018-12-17 22:55:45 -05:00
Yuntai Kyong
7a8bec750d
Rewrite most of process_onion_failure
2018-12-17 22:55:45 -05:00
Matt Corallo
150e9f0f8c
Include the node id in ChannelManager test logs
2018-12-14 17:01:12 -05:00
Antoine Riard
7a483e597c
Typify payment_hash and payment_preimage
...
Fix variable name as payment_hash instead of txid for index
of remote_hash_commitment_number in ChannelMonitor reader
2018-12-14 17:00:50 -05:00
Antoine Riard
96d17ee737
Add is_resolving_output in ChannelMonitor
...
Called in ChannelMonitor block_connected, returning
HTLCUpdate upstream via ManyChannelMonitor to
link htlcs between monitors. Used by ChannelManager to
fulfill/fail htlcs backwards accordingly
If spurrious HTLCUpdate are generated due to block re-scan
and htlc are already LocalRemoved, discard them in
channel get_update_*_htlc
2018-12-13 11:53:44 -05:00
Antoine Riard
e86e10b87d
Refactor KeyStorage as Storage
...
Move PrivMode as Local, SigsMode as Watchtower
Cut funnding_txo from ChannelMonitor, move it inside Local
Rename log_funding_option as log_funding_info
2018-12-04 11:24:19 -05:00
Yuntai Kyong
7e59e1e392
Add a method to get session secret for onion packet to KeysInterface
2018-11-27 10:44:51 +09:00
Schalk van Heerden
8d7b498974
Handle-initial_routing_sync-requests-from-peers-in-their-Init-messages
2018-11-09 13:53:13 +10:30
Matt Corallo
182affc03b
Test the various shutdown handling updates
2018-11-02 22:26:51 -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
64bd2eaa7f
Give ManyChannelMonitor a logger and trace add_update events
2018-10-29 14:26:05 -04:00
Matt Corallo
a2fb3ccc08
Implement and document Channel/ChannelManager (de)serialization
2018-10-27 09:58:10 -04:00
Matt Corallo
56513f2927
Track last_block_hash in ChannelMonitor and expose it on deser
...
Also make block_connected take a &mut self to ensure serialized
state will always be self-consistent.
2018-10-27 09:42:04 -04:00
Matt Corallo
f0490118b3
impl some additional (de)serializers, including a u48 wrapper type
2018-10-27 09:42:04 -04:00
Matt Corallo
47fe673c57
Give ChannelMonitor a logger via new ReadableArgs trait
2018-10-27 09:42:04 -04:00
Matt Corallo
062a02da1a
Add a second Readable trait for state args, clean macros slightly
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
8c235d9e28
Generate Events from ChannelMonitor to indicate spendable ouputs
...
Extend KeyStorage with delayed_payment_base_key and per_commitment_point
to derive local_delayed private key
2018-10-27 09:34:28 -04:00
Yuntai Kyong
bdbb2f077e
Comments updated for PaymentReceived
2018-10-25 20:15:21 -04: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
b02670a920
Add an Event for sending revoke_and_ack messages out-of-band
2018-10-23 16:03:30 -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
Matt Corallo
d49802fb8f
Use APIError::ChannelUnavailable a bit more for consistency
2018-10-17 21:28:22 -04:00
Matt Corallo
c52616ddd7
Add documentation about PaymentSent/Failed event duplication bug
2018-10-15 23:06:04 -04:00
Yuntai Kyong
18ce6c8fd8
add a ChannelUnavailable error
2018-10-03 08:45:34 +09:00
Matt Corallo
6e1318b0e2
Make docs look nicer by adding explicit spacing
2018-09-20 12:58:10 -04:00