From e4acb2ae3af6ab1ac637aefe3362429e9c0bf703 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Tue, 17 Aug 2021 11:22:47 +0700 Subject: [PATCH] fix many nil-pointers --- txpool/pool.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/txpool/pool.go b/txpool/pool.go index bb0d769ad..3a3d799a8 100644 --- a/txpool/pool.go +++ b/txpool/pool.go @@ -183,26 +183,22 @@ func (p *TxPool) GetRlp(hash []byte) []byte { func (p *TxPool) AppendLocalHashes(buf []byte) { p.lock.RLock() defer p.lock.RUnlock() - i := 0 for hash, txn := range p.byHash { if txn.subPool&IsLocal == 0 { continue } - buf = append(buf[i*32:], hash...) - i++ + buf = append(buf, hash...) } } func (p *TxPool) AppendRemoteHashes(buf []byte) { p.lock.RLock() defer p.lock.RUnlock() - i := 0 for hash, txn := range p.byHash { if txn.subPool&IsLocal != 0 { continue } - buf = append(buf[i*32:], hash...) - i++ + buf = append(buf, hash...) } } func (p *TxPool) AppendAllHashes(buf []byte) {