mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-13 10:21:37 +00:00
chore: improve comments
This commit is contained in:
parent
96891be7f9
commit
c961983210
3 changed files with 7 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue