mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
compare genesis during peering handshake (#327)
* wip - send genesis in handshake * error if genesis mismatch on handshake * fix the tests * preserve order of existing fields in hand/shake
This commit is contained in:
parent
e50703d79e
commit
487e50c3d2
1 changed files with 2 additions and 1 deletions
|
@ -85,11 +85,12 @@ impl Server {
|
||||||
capab: Capabilities,
|
capab: Capabilities,
|
||||||
config: P2PConfig,
|
config: P2PConfig,
|
||||||
adapter: Arc<ChainAdapter>,
|
adapter: Arc<ChainAdapter>,
|
||||||
|
genesis: Hash,
|
||||||
) -> Result<Server, Error> {
|
) -> Result<Server, Error> {
|
||||||
Ok(Server {
|
Ok(Server {
|
||||||
config: config,
|
config: config,
|
||||||
capabilities: capab,
|
capabilities: capab,
|
||||||
handshake: Arc::new(Handshake::new()),
|
handshake: Arc::new(Handshake::new(genesis)),
|
||||||
peers: Peers::new(PeerStore::new(db_root)?, adapter),
|
peers: Peers::new(PeerStore::new(db_root)?, adapter),
|
||||||
stop: RefCell::new(None),
|
stop: RefCell::new(None),
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue