]> git.bitcoin.ninja Git - rust-lightning/commit
Make `NetworkGraph` Clone-able again 2021-09-clonable-netgraph
authorMatt Corallo <git@bluematt.me>
Sun, 26 Sep 2021 04:20:44 +0000 (04:20 +0000)
committerMatt Corallo <git@bluematt.me>
Sun, 26 Sep 2021 04:31:29 +0000 (04:31 +0000)
commit6c569d82b024ceb89a644c133610d664ec06186a
tree01eade307eedc2029f91e7ec641fdedcbf7e5d6a
parent367a2ccf2c1856bba67f12c82a4ab80d7941616f
Make `NetworkGraph` Clone-able again

There isn't a lot of user-utility for cloning `NetworkGraph`
directly (its a rather large struct, and there probably isn't a lot
of reason to have *multiple* `NetworkGraph`s). Thus, when locks
were pushed down into it, the `Clone`-ability of it was dropped as
well.

Sadly, mapping the Java memory model onto:
 * `Read`-ing a `NetworkGraph`, creating a Java-owned
   `NetworkGraph` object that the JVM will destruct for us,
 * Passing it to a `NetGraphMsgHandler`, which now expects to own
   the `NetworkGraph`, including destructing it,
isn't really practical without adding a clone in between.

Given this, and the fact that there's nothing inherently wrong with
clone-ing a `NetworkGraph`, we simply re-add `Clone` here.
lightning/src/routing/network_graph.rs