mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-15 11:21:36 +00:00
replace RWMutex with Mutex
This commit is contained in:
parent
d7a26252b7
commit
5b72989dfd
1 changed files with 3 additions and 3 deletions
|
|
@ -76,7 +76,7 @@ type Peer struct {
|
||||||
resDispatch chan *response // Dispatch channel to fulfil pending requests and untrack them
|
resDispatch chan *response // Dispatch channel to fulfil pending requests and untrack them
|
||||||
|
|
||||||
receiptBuffer map[uint64]*receiptRequest // Previously requested receipts to buffer partial receipts
|
receiptBuffer map[uint64]*receiptRequest // Previously requested receipts to buffer partial receipts
|
||||||
receiptBufferLock sync.RWMutex // Lock for protecting the receiptBuffer
|
receiptBufferLock sync.Mutex // Lock for protecting the receiptBuffer
|
||||||
|
|
||||||
term chan struct{} // Termination channel to stop the broadcasters
|
term chan struct{} // Termination channel to stop the broadcasters
|
||||||
}
|
}
|
||||||
|
|
@ -402,8 +402,8 @@ func (p *Peer) RequestReceipts(hashes []common.Hash, gasUsed []uint64, sink chan
|
||||||
|
|
||||||
// HandlePartialReceipts re-request partial receipts
|
// HandlePartialReceipts re-request partial receipts
|
||||||
func (p *Peer) requestPartialReceipts(id uint64) error {
|
func (p *Peer) requestPartialReceipts(id uint64) error {
|
||||||
p.receiptBufferLock.RLock()
|
p.receiptBufferLock.Lock()
|
||||||
defer p.receiptBufferLock.RUnlock()
|
defer p.receiptBufferLock.Unlock()
|
||||||
|
|
||||||
// Do not re-request for the stale request
|
// Do not re-request for the stale request
|
||||||
if _, ok := p.receiptBuffer[id]; !ok {
|
if _, ok := p.receiptBuffer[id]; !ok {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue