Add a C-bindings-compatible read lock type for NetworkGraph 2020-08-c-bindings-cleanups-3
authorMatt Corallo <git@bluematt.me>
Mon, 24 Aug 2020 18:14:05 +0000 (14:14 -0400)
committerMatt Corallo <git@bluematt.me>
Wed, 26 Aug 2020 01:26:51 +0000 (21:26 -0400)
commitd224c1def44f167afd711515484207f2f4966d2d
tree4fdadbf3932a26fba719e96777c4b3675ef5cb7c
parentc6bae1fdb023c4982cc01f53507b3bc1b63dbac6
Add a C-bindings-compatible read lock type for NetworkGraph

In order to calculate a route, it is likely that users need to take
a read()-lock on NetGraphMsgHandler::network_graph. This is not
possible naively from C bindings, as Rust's native RwLock is not
exposed.

Thus, we provide a simple wrapper around the RwLockReadGuard and
expose simple accessor methods.
lightning/src/routing/network_graph.rs