Simplify field names

This commit is contained in:
Sunny Katkuri 2018-09-20 17:21:48 +00:00
parent 60e3fc31f2
commit ee6feadbc2
3 changed files with 5 additions and 5 deletions

View file

@ -789,11 +789,11 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
expectedDiff := float64(body.NTxs) / (grapheneC * grapheneTau) expectedDiff := float64(body.NTxs) / (grapheneC * grapheneTau)
bloomFPR := expectedDiff / float64((body.NPending - body.NTxs) + 1) bloomFPR := expectedDiff / float64((body.NPending - body.NTxs) + 1)
bloomFilter := bloom.NewWithEstimates(body.NTxs, bloomFPR) bloomFilter := bloom.NewWithEstimates(body.NTxs, bloomFPR)
bloomFilter.GobDecode(body.GrapheneBloom) bloomFilter.GobDecode(body.BloomFilter)
ibltRow := grapheneIBLTLookupTable[int(math.Ceil(expectedDiff))] ibltRow := grapheneIBLTLookupTable[int(math.Ceil(expectedDiff))]
receivedIBLT := iblt.New(ibltRow[0], ibltRow[1]) receivedIBLT := iblt.New(ibltRow[0], ibltRow[1])
receivedIBLT.UnmarshalBinary(body.GrapheneIBLT) receivedIBLT.UnmarshalBinary(body.IBLT)
localIBLT := iblt.New(ibltRow[0], ibltRow[1]) localIBLT := iblt.New(ibltRow[0], ibltRow[1])

View file

@ -342,7 +342,7 @@ func (p *peer) RequestGraphene(hash common.Hash, nTxs int) error {
// SendGraphene sends the graphene message in response to a RequestGraphene // 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 { 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) 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})
} }

View file

@ -194,8 +194,8 @@ type getGrapheneData struct {
// grapheneData represents the Bloom filter and IBLT that make up a graphene message // grapheneData represents the Bloom filter and IBLT that make up a graphene message
type grapheneData struct { type grapheneData struct {
GrapheneIBLT []byte IBLT []byte
GrapheneBloom []byte BloomFilter []byte
NPending uint NPending uint
NTxs uint NTxs uint
Hash common.Hash Hash common.Hash