diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-03-27 20:47:32 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 13:50:05 +0800 |
commit | 675ae00de8daa140a26c5282b16b2ea695da6d9b (patch) | |
tree | aaa99e7d103c88a2bde6ee3c1839afe0bfec1bbd /dex/network.go | |
parent | ce280c6728552c38ddc6c8ca964c84e46e80dff5 (diff) | |
download | dexon-675ae00de8daa140a26c5282b16b2ea695da6d9b.tar dexon-675ae00de8daa140a26c5282b16b2ea695da6d9b.tar.gz dexon-675ae00de8daa140a26c5282b16b2ea695da6d9b.tar.bz2 dexon-675ae00de8daa140a26c5282b16b2ea695da6d9b.tar.lz dexon-675ae00de8daa140a26c5282b16b2ea695da6d9b.tar.xz dexon-675ae00de8daa140a26c5282b16b2ea695da6d9b.tar.zst dexon-675ae00de8daa140a26c5282b16b2ea695da6d9b.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.go | 23 |
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. |