From ee6feadbc2f178beba3b4d2a39cde156e9e1691a Mon Sep 17 00:00:00 2001 From: Sunny Katkuri Date: Thu, 20 Sep 2018 17:21:48 +0000 Subject: [PATCH] Simplify field names --- eth/handler.go | 4 ++-- eth/peer.go | 2 +- eth/protocol.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eth/handler.go b/eth/handler.go index 98a344765c..dfe0b30db4 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -789,11 +789,11 @@ func (pm *ProtocolManager) handleMsg(p *peer) error { expectedDiff := float64(body.NTxs) / (grapheneC * grapheneTau) bloomFPR := expectedDiff / float64((body.NPending - body.NTxs) + 1) bloomFilter := bloom.NewWithEstimates(body.NTxs, bloomFPR) - bloomFilter.GobDecode(body.GrapheneBloom) + bloomFilter.GobDecode(body.BloomFilter) ibltRow := grapheneIBLTLookupTable[int(math.Ceil(expectedDiff))] receivedIBLT := iblt.New(ibltRow[0], ibltRow[1]) - receivedIBLT.UnmarshalBinary(body.GrapheneIBLT) + receivedIBLT.UnmarshalBinary(body.IBLT) localIBLT := iblt.New(ibltRow[0], ibltRow[1]) diff --git a/eth/peer.go b/eth/peer.go index 2eb8c15322..c5c403c656 100644 --- a/eth/peer.go +++ b/eth/peer.go @@ -342,7 +342,7 @@ func (p *peer) RequestGraphene(hash common.Hash, nTxs int) error { // SendGraphene sends the graphene message in response to a RequestGraphene func (p *peer) SendGraphene(hash common.Hash, i []byte, b []byte, nPending uint, nTxs uint, indexArray []byte, uncles []*types.Header) error { p.Log().Debug("Sending graphene", "block", hash) - return p2p.Send(p.rw, GrapheneMsg, &grapheneData{Hash: hash, GrapheneIBLT: i, GrapheneBloom: b, NPending: nPending, NTxs: nTxs, Indices: indexArray, Uncles: uncles}) + return p2p.Send(p.rw, GrapheneMsg, &grapheneData{Hash: hash, IBLT: i, BloomFilter: b, NPending: nPending, NTxs: nTxs, Indices: indexArray, Uncles: uncles}) } diff --git a/eth/protocol.go b/eth/protocol.go index acb889a862..345e9b4160 100644 --- a/eth/protocol.go +++ b/eth/protocol.go @@ -194,8 +194,8 @@ type getGrapheneData struct { // grapheneData represents the Bloom filter and IBLT that make up a graphene message type grapheneData struct { - GrapheneIBLT []byte - GrapheneBloom []byte + IBLT []byte + BloomFilter []byte NPending uint NTxs uint Hash common.Hash