node/pkg/p2p: store own heartbeat in GuardianSetState

Change-Id: I6b9ab2ce267161d20c17d5d528fd7741c2eb48b4
This commit is contained in:
Leo 2021-08-07 21:54:20 +02:00 committed by Leopold Schabel
parent 3dcf1f1998
commit 336f373bb5
1 changed files with 3 additions and 1 deletions

View File

@ -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)