From 336f373bb5246edc14d032b555e67c1bfd58a8bd Mon Sep 17 00:00:00 2001 From: Leo Date: Sat, 7 Aug 2021 21:54:20 +0200 Subject: [PATCH] node/pkg/p2p: store own heartbeat in GuardianSetState Change-Id: I6b9ab2ce267161d20c17d5d528fd7741c2eb48b4 --- bridge/pkg/p2p/p2p.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bridge/pkg/p2p/p2p.go b/bridge/pkg/p2p/p2p.go index d7cc8180..7cb3239e 100644 --- a/bridge/pkg/p2p/p2p.go +++ b/bridge/pkg/p2p/p2p.go @@ -201,7 +201,9 @@ func Run(obsvC chan *gossipv1.SignedObservation, sendC chan []byte, rawHeartbeat GuardianAddr: DefaultRegistry.guardianAddress, } + ourAddr := ethcrypto.PubkeyToAddress(gk.PublicKey) rawHeartbeatListeners.PublishHeartbeat(heartbeat) + gst.SetHeartBeat(ourAddr, heartbeat) b, err := proto.Marshal(heartbeat) if err != nil { @@ -221,7 +223,7 @@ func Run(obsvC chan *gossipv1.SignedObservation, sendC chan []byte, rawHeartbeat SignedHeartbeat: &gossipv1.SignedHeartbeat{ Heartbeat: b, Signature: sig, - GuardianAddr: ethcrypto.PubkeyToAddress(gk.PublicKey).Bytes(), + GuardianAddr: ourAddr.Bytes(), }}} b, err = proto.Marshal(&msg)