mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-01 00:31:21 +00:00
fix many nil-pointers
This commit is contained in:
parent
9e67a858e6
commit
e4acb2ae3a
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user