Keep track of the Init Features for every connected/channel'd peer
authorMatt Corallo <git@bluematt.me>
Sun, 29 Dec 2019 19:22:43 +0000 (14:22 -0500)
committerMatt Corallo <git@bluematt.me>
Mon, 20 Jan 2020 03:47:08 +0000 (22:47 -0500)
commita19d71d0b2768f2aee747b07be509b6591378e7a
tree786e1ec858048cceb69c8528157a51deabbbfde5
parentd2ba7caf474218ab81d9aacfaeec97776a042f3c
Keep track of the Init Features for every connected/channel'd peer

Since we want to keep track of the Init-context features for every
peer we have channels with, we have to keep them for as long as the
peer is connected (since we may open a channel with them at any
point).

We go ahead and take this opportunity to create a new per-peer-state
struct which has two levels of mutexes which is appropriate for
moving channel storage to.

Since we can't process messages from a given peer in parallel, the
inner lock is a regular mutex, but the outer lock is RW so that we
can process for different peers at the same time with an outer read
lock.
lightning/src/ln/channelmanager.rs