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) {