p2p: peer.Key -> peer.ID

This commit is contained in:
Ethan Buchman
2018-01-01 21:27:38 -05:00
parent b289d2baf4
commit a17105fd46
20 changed files with 137 additions and 117 deletions

View File

@@ -28,7 +28,7 @@ func init() {
}
type PeerMessage struct {
PeerKey string
PeerID ID
Bytes []byte
Counter int
}
@@ -77,7 +77,7 @@ func (tr *TestReactor) Receive(chID byte, peer Peer, msgBytes []byte) {
tr.mtx.Lock()
defer tr.mtx.Unlock()
//fmt.Printf("Received: %X, %X\n", chID, msgBytes)
tr.msgsReceived[chID] = append(tr.msgsReceived[chID], PeerMessage{peer.Key(), msgBytes, tr.msgsCounter})
tr.msgsReceived[chID] = append(tr.msgsReceived[chID], PeerMessage{peer.ID(), msgBytes, tr.msgsCounter})
tr.msgsCounter++
}
}