From 5b72989dfdf32ca94a46dd2e6b307217ec2e27dd Mon Sep 17 00:00:00 2001 From: healthykim Date: Thu, 19 Mar 2026 01:54:07 +0900 Subject: [PATCH] replace RWMutex with Mutex --- eth/protocols/eth/peer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eth/protocols/eth/peer.go b/eth/protocols/eth/peer.go index 412309a1dc..b58aa4699a 100644 --- a/eth/protocols/eth/peer.go +++ b/eth/protocols/eth/peer.go @@ -76,7 +76,7 @@ type Peer struct { resDispatch chan *response // Dispatch channel to fulfil pending requests and untrack them 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 } @@ -402,8 +402,8 @@ func (p *Peer) RequestReceipts(hashes []common.Hash, gasUsed []uint64, sink chan // HandlePartialReceipts re-request partial receipts func (p *Peer) requestPartialReceipts(id uint64) error { - p.receiptBufferLock.RLock() - defer p.receiptBufferLock.RUnlock() + p.receiptBufferLock.Lock() + defer p.receiptBufferLock.Unlock() // Do not re-request for the stale request if _, ok := p.receiptBuffer[id]; !ok {