aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dex/handler.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/dex/handler.go b/dex/handler.go
index 87f8b6b1d..2b7e1cee1 100644
--- a/dex/handler.go
+++ b/dex/handler.go
@@ -854,7 +854,9 @@ func (pm *ProtocolManager) BroadcastAgreementResult(
round: agreement.Position.Round,
}
for _, peer := range pm.peers.PeersWithLabel(label) {
- peer.AsyncSendAgreement(agreement)
+ if !peer.knownAgreements.Contains(rlpHash(agreement)) {
+ peer.AsyncSendAgreement(agreement)
+ }
}
// TODO(sonic): send to some of other nodes (gossip)
@@ -872,7 +874,9 @@ func (pm *ProtocolManager) BroadcastRandomnessResult(
round: randomness.Position.Round,
}
for _, peer := range pm.peers.PeersWithLabel(label) {
- peer.AsyncSendRandomness(randomness)
+ if !peer.knownRandomnesses.Contains(rlpHash(randomness)) {
+ peer.AsyncSendRandomness(randomness)
+ }
}
// TODO(sonic): send to some of other nodes (gossip)