mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-02 20:16:15 -04:00
move updatePeers directly to the VPN and omit the store layer (#4)
This commit is contained in:
parent
6bbb783af8
commit
6f695892bf
7 changed files with 336 additions and 195 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
"github.com/edgelesssys/constellation/coordinator/attestation/vtpm"
|
||||
"github.com/edgelesssys/constellation/coordinator/core"
|
||||
"github.com/edgelesssys/constellation/coordinator/kms"
|
||||
"github.com/edgelesssys/constellation/coordinator/peer"
|
||||
"github.com/edgelesssys/constellation/coordinator/pubapi"
|
||||
"github.com/edgelesssys/constellation/coordinator/pubapi/pubproto"
|
||||
"github.com/edgelesssys/constellation/coordinator/store"
|
||||
|
@ -339,6 +340,19 @@ func (v *fakeVPN) RemovePeer(pubKey []byte) error {
|
|||
panic("dummy")
|
||||
}
|
||||
|
||||
func (v *fakeVPN) UpdatePeers(peers []peer.Peer) error {
|
||||
for _, peer := range peers {
|
||||
peerIP, _, err := net.SplitHostPort(peer.PublicEndpoint)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := v.AddPeer(peer.VPNPubKey, peerIP, peer.VPNIP); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *fakeVPN) send(dst string, data string) {
|
||||
pubdst := v.peers[dst]
|
||||
packets := v.netw.packets
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue