aboutsummaryrefslogtreecommitdiffstats
path: root/dex/peer.go
diff options
context:
space:
mode:
authorSonic <sonic@cobinhood.com>2018-10-20 10:10:47 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:50 +0800
commitdca561583b7657dd65b39e0a196cb026d608ba11 (patch)
treee3ef80028dab1c72e1666009ffed69c54cbbdb3d /dex/peer.go
parenta18db064261a0336d7cf5b375583ece163d42dbb (diff)
downloaddexon-dca561583b7657dd65b39e0a196cb026d608ba11.tar.gz
dexon-dca561583b7657dd65b39e0a196cb026d608ba11.tar.zst
dexon-dca561583b7657dd65b39e0a196cb026d608ba11.zip
dex: no need to rlp encode/decode now, consensus supports it
Diffstat (limited to 'dex/peer.go')
-rw-r--r--dex/peer.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/dex/peer.go b/dex/peer.go
index db68ea590..a5e0dd21a 100644
--- a/dex/peer.go
+++ b/dex/peer.go
@@ -388,16 +388,14 @@ func (p *peer) AsyncSendNewBlock(block *types.Block, td *big.Int) {
}
func (p *peer) SendLatticeBlock(block *coreTypes.Block) error {
- r := toRLPLatticeBlock(block)
- p.knownLatticeBlocks.Add(rlpHash(r))
- return p2p.Send(p.rw, LatticeBlockMsg, toRLPLatticeBlock(block))
+ p.knownLatticeBlocks.Add(rlpHash(block))
+ return p2p.Send(p.rw, LatticeBlockMsg, block)
}
func (p *peer) AsyncSendLatticeBlock(block *coreTypes.Block) {
select {
case p.queuedLatticeBlocks <- block:
- r := toRLPLatticeBlock(block)
- p.knownLatticeBlocks.Add(rlpHash(r))
+ p.knownLatticeBlocks.Add(rlpHash(block))
default:
p.Log().Debug("Dropping lattice block propagation")
}
@@ -446,16 +444,14 @@ func (p *peer) AsyncSendRandomness(randomness *coreTypes.BlockRandomnessResult)
}
func (p *peer) SendDKGPrivateShare(privateShare *coreTypes.DKGPrivateShare) error {
- r := toRLPDKGPrivateShare(privateShare)
- p.knownDKGPrivateShares.Add(rlpHash(r))
- return p2p.Send(p.rw, DKGPrivateShareMsg, toRLPDKGPrivateShare(privateShare))
+ p.knownDKGPrivateShares.Add(rlpHash(privateShare))
+ return p2p.Send(p.rw, DKGPrivateShareMsg, privateShare)
}
func (p *peer) AsyncSendDKGPrivateShare(privateShare *coreTypes.DKGPrivateShare) {
select {
case p.queuedDKGPrivateShares <- privateShare:
- r := toRLPDKGPrivateShare(privateShare)
- p.knownDKGPrivateShares.Add(rlpHash(r))
+ p.knownDKGPrivateShares.Add(rlpHash(privateShare))
default:
p.Log().Debug("Dropping DKG private share")
}