diff --git a/eth/protocols/eth/dispatcher.go b/eth/protocols/eth/dispatcher.go index 7a97a7a7ca..37be07abde 100644 --- a/eth/protocols/eth/dispatcher.go +++ b/eth/protocols/eth/dispatcher.go @@ -53,8 +53,6 @@ type Request struct { Peer string // Demultiplexer if cross-peer requests are batched together Sent time.Time // Timestamp when the request was sent - - continued bool } // Close aborts an in-flight request. Although there's no way to notify the diff --git a/eth/protocols/eth/handlers.go b/eth/protocols/eth/handlers.go index 9d2f1d701a..a6c7b1c576 100644 --- a/eth/protocols/eth/handlers.go +++ b/eth/protocols/eth/handlers.go @@ -353,8 +353,9 @@ func serviceGetReceiptsQuery69(chain *core.BlockChain, query GetReceiptsRequest) } // serviceGetReceiptsQuery70 assembles the response to a receipt query. -// If the receipts exceed 10 MiB, it trims them and sets the lastBlockIncomplete flag. -// Indices smaller than firstBlockReceiptIndex are omitted from the first block receipt list. +// If the receipts exceed 10 MiB, it trims them and sets the +// lastBlockIncomplete flag. Indices smaller than firstBlockReceiptIndex +// are omitted from the first block receipt list. func serviceGetReceiptsQuery70(chain *core.BlockChain, query GetReceiptsRequest, firstBlockReceiptIndex uint64) ([]rlp.RawValue, bool) { var ( bytes int diff --git a/eth/protocols/eth/peer.go b/eth/protocols/eth/peer.go index ed33cd5010..d6a8614cc2 100644 --- a/eth/protocols/eth/peer.go +++ b/eth/protocols/eth/peer.go @@ -43,7 +43,7 @@ const ( maxQueuedTxAnns = 4096 ) -type partialReceipt struct { +type receiptRequest struct { request []common.Hash list []*ReceiptList69 // list of partially collected receipts lastLogSize uint64 // log size of last receipt list @@ -67,7 +67,7 @@ type Peer struct { reqCancel chan *cancel // Dispatch channel to cancel pending requests and untrack them resDispatch chan *response // Dispatch channel to fulfil pending requests and untrack them - receiptBuffer map[uint64]*partialReceipt // requestId to receiptlist map + receiptBuffer map[uint64]*receiptRequest // Previously requested receipts to buffer partial receipts term chan struct{} // Termination channel to stop the broadcasters } @@ -87,7 +87,7 @@ func NewPeer(version uint, p *p2p.Peer, rw p2p.MsgReadWriter, txpool TxPool) *Pe reqCancel: make(chan *cancel), resDispatch: make(chan *response), txpool: txpool, - receiptBuffer: make(map[uint64]*partialReceipt), + receiptBuffer: make(map[uint64]*receiptRequest), term: make(chan struct{}), } // Start up all the broadcasters @@ -356,7 +356,7 @@ func (p *Peer) RequestReceipts(hashes []common.Hash, sink chan *Response) (*Requ FirstBlockReceiptIndex: 0, }, } - p.receiptBuffer[id] = &partialReceipt{request: hashes} + p.receiptBuffer[id] = &receiptRequest{request: hashes} } else { req = &Request{ id: id,