From f79d09a12c8de2e1572292ef6bbd82352526930d Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Thu, 27 Dec 2018 09:17:28 +0800 Subject: dex: add pull randomness (#105) * vendor: sync to latest core * dex: Add PullRandomness --- dex/network.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'dex/network.go') diff --git a/dex/network.go b/dex/network.go index 38ee614ad..c5f81782d 100644 --- a/dex/network.go +++ b/dex/network.go @@ -34,6 +34,9 @@ func NewDexconNetwork(pm *ProtocolManager) *DexconNetwork { // PullBlocks tries to pull blocks from the DEXON network. func (n *DexconNetwork) PullBlocks(hashes coreCommon.Hashes) { + if len(hashes) == 0 { + return + } n.pm.BroadcastPullBlocks(hashes) } @@ -42,6 +45,14 @@ 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) -- cgit v1.2.3