aboutsummaryrefslogtreecommitdiffstats
path: root/dex/network.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-03-27 20:47:32 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-15 22:09:55 +0800
commit8732c918f7b5d3dd9ac45b6e00995f5d74bc8a47 (patch)
treeab7aed4bb7d580011469dda917483e785c234a32 /dex/network.go
parentc52c9e04a916fac3550b0a3c3d8cdf979ab70bb8 (diff)
downloadgo-tangerine-8732c918f7b5d3dd9ac45b6e00995f5d74bc8a47.tar.gz
go-tangerine-8732c918f7b5d3dd9ac45b6e00995f5d74bc8a47.tar.zst
go-tangerine-8732c918f7b5d3dd9ac45b6e00995f5d74bc8a47.zip
core: merge notarySet and DKGSet (#265)
* vendor: sync to latest core * core: merge notarySet and dkgSet * dex: optimize network traffic for finalized block
Diffstat (limited to 'dex/network.go')
-rw-r--r--dex/network.go23
1 files changed, 7 insertions, 16 deletions
diff --git a/dex/network.go b/dex/network.go
index f36850e59..0e2d338c1 100644
--- a/dex/network.go
+++ b/dex/network.go
@@ -45,14 +45,6 @@ func (n *DexconNetwork) PullVotes(pos types.Position) {
n.pm.BroadcastPullVotes(pos)
}
-// PullRandomness tries to pull randomness result from the DEXON network.
-func (n *DexconNetwork) PullRandomness(hashes coreCommon.Hashes) {
- if len(hashes) == 0 {
- return
- }
- n.pm.BroadcastPullRandomness(hashes)
-}
-
// BroadcastVote broadcasts vote to all nodes in DEXON network.
func (n *DexconNetwork) BroadcastVote(vote *types.Vote) {
n.pm.BroadcastVote(vote)
@@ -60,7 +52,11 @@ func (n *DexconNetwork) BroadcastVote(vote *types.Vote) {
// BroadcastBlock broadcasts block to all nodes in DEXON network.
func (n *DexconNetwork) BroadcastBlock(block *types.Block) {
- n.pm.BroadcastCoreBlock(block)
+ if block.IsFinalized() {
+ n.pm.BroadcastFinalizedBlock(block)
+ } else {
+ n.pm.BroadcastCoreBlock(block)
+ }
}
// SendDKGPrivateShare sends PrivateShare to a DKG participant.
@@ -83,13 +79,8 @@ func (n *DexconNetwork) BroadcastDKGPartialSignature(
}
// BroadcastAgreementResult broadcasts rand request to DKG set.
-func (n *DexconNetwork) BroadcastAgreementResult(randRequest *types.AgreementResult) {
- n.pm.BroadcastAgreementResult(randRequest)
-}
-
-// BroadcastRandomnessResult broadcasts rand request to Notary set.
-func (n *DexconNetwork) BroadcastRandomnessResult(randResult *types.BlockRandomnessResult) {
- n.pm.BroadcastRandomnessResult(randResult)
+func (n *DexconNetwork) BroadcastAgreementResult(result *types.AgreementResult) {
+ n.pm.BroadcastAgreementResult(result)
}
// ReceiveChan returns a channel to receive messages from DEXON network.