-
Notifications
You must be signed in to change notification settings - Fork 670
Use same gob encoder/decoder for peers and peer connections #619
Conversation
@@ -25,6 +25,13 @@ type NameCollisionError struct { | |||
|
|||
type PeerNameSet map[PeerName]struct{} | |||
|
|||
type ConnectionView struct { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@@ -233,7 +237,7 @@ func (peers *Peers) decodeUpdate(update []byte) (newPeers map[PeerName]*Peer, de | |||
return | |||
} | |||
|
|||
func (peers *Peers) applyUpdate(decodedUpdate []*Peer, decodedConns [][]byte) map[PeerName]*Peer { | |||
func (peers *Peers) applyUpdate(decodedUpdate []*Peer, decodedConns [][]ConnectionView) map[PeerName]*Peer { | |||
newUpdate := make(map[PeerName]*Peer) | |||
for idx, newPeer := range decodedUpdate { | |||
connsBuf := decodedConns[idx] |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
I am curious whether this change makes any difference to the time it takes |
I've made the suggested changes as well as introducing |
The linter is moaning. And the inclusion of |
This has made a massive improvement to cluster formation. Running |
Partially addresses #519 by merging the first two layers of gob.