Commit graph

160 commits

Author SHA1 Message Date
Matt Corallo
174ccf5abe Fix typo in lightning-net-tokio crate description. 2020-03-11 12:19:39 -04:00
Matt Corallo
06d3b20512 Fix (and test) net-tokio outbound conns without a threaded env 2020-03-11 12:19:39 -04:00
Matt Corallo
60d37b2698 Fix long-standing race in net-tokio reading after a disconnect event
If rust-lightning tells us to disconnect a socket after we read
some bytes from the socket, but before we actually give those bytes
to rust-lightning, we may end up calling rust-lightning with a
Descriptor that isn't registered anymore.

Sadly, there really isn't a good way to solve this, and it should
be a pretty quick event, so we just busy-wait.
2020-03-11 12:19:39 -04:00
Matt Corallo
5ada940464 Rewrite lightning-net-tokio using async/await and tokio 0.2
This is a rather major rewrite, using async/await and tokio 0.2,
which cleans up the code a ton as well as adds significantly to
readability.
2020-03-11 12:19:39 -04:00
Matt Corallo
6f06858304 Swap read_event read type for a slice isntead of a Vec
It looks like we don't currently use the Vec as a Vec, and can
happily take a slice, which makes things easier on the calling
side.
2020-03-10 11:52:12 -04:00
Matt Corallo
faaa4d207d Fix incorrect docs around disconnect in peer_handler + rename fns
The way PeerHandler was written, it was supposed to remove from
self.peers iff the API docs indicate that disconnect_event should
NOT be called (and otherwise rely on disconnect_event to do so).

Sadly, the implementation was way out of whack with reality - in
the implementation, essentially anywhere where PeerHandler
originated the disconnection, the peer was removed and no
disconnect_event was expected. The docs, however, indicated that
disconnect_event should nearly only be called, only not doing so
when the initial handshake message never completed.

We opt to change the docs, mostly, as well as clean up the
ping/pong handling somewhat and rename a few functions to clarify
what they actually do.
2020-02-20 20:48:13 -05:00
Valentine Wallace
4833d1acf9 Update ChannelManager's ChannelMonitor Arc to be a Deref
Additional changes:
* Update fuzz crate to match ChannelManager's new API
* Update lightning-net-tokio library to match ChannelManager's new ChannelMonitor Deref API
* Update tests to match ChannelManager's new ChannelMonitor Deref API
2020-01-25 14:39:52 -05:00
Matt Corallo
1e52786e1c Bump versions to 0.0.10 2019-12-11 18:17:54 -05:00
Matt Corallo
6fc775da45 Bump bitcoin dep to 0.21 2019-12-11 18:17:54 -05:00
RJ Rybarczyk
88fef649b1 Use workspaces to separate crates 2019-11-15 02:44:30 +00:00