Instead of storing received gossip messages in an in-memory `BTreeMap`, we persist them to the database (`addresses.db`). There are two reasons for this: 1. Node restarts do not wipe the state, meaning that it is much less likely that some gossip message will get lost before reaching all nodes. 2. This will allow us in the next commit to know how far behind we are after a restart, to be able to request the correct time range of gossip messages that we missed while offline. Note that we now share the addresses.db file between two connections and stores, which we don't do anywhere else. Having multiple connections to the same database is fine, but the way we're having to do it is a bit awkward. In a future patch, we could pull out the database schema from the `address` module and rename the database to make things clearer. |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||