mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-07 19:41:19 +00:00
add state check assert routine
This commit is contained in:
parent
e6a39ce9fc
commit
3ab6b5074c
@ -1120,19 +1120,6 @@ func (p *TxPool) discardLocked(mt *metaTx) {
|
||||
func (p *TxPool) fromDB(ctx context.Context, tx kv.RwTx, coreTx kv.Tx) error {
|
||||
p.lock.Lock()
|
||||
defer p.lock.Unlock()
|
||||
if err := p.senders.fromDB(ctx, tx, coreTx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := tx.ForEach(kv.RecentLocalTransaction, nil, func(k, v []byte) error {
|
||||
hashID := [32]byte{}
|
||||
copy(hashID[:], v)
|
||||
p.localsHistory.Add(hashID, struct{}{})
|
||||
return nil
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if ASSERT {
|
||||
tx.ForEach(kv.PooledTransaction, nil, func(k, v []byte) error {
|
||||
vv, err := tx.GetOne(kv.PooledSenderIDToAdress, v[:8])
|
||||
@ -1152,6 +1139,18 @@ func (p *TxPool) fromDB(ctx context.Context, tx kv.RwTx, coreTx kv.Tx) error {
|
||||
return nil
|
||||
})
|
||||
}
|
||||
if err := p.senders.fromDB(ctx, tx, coreTx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := tx.ForEach(kv.RecentLocalTransaction, nil, func(k, v []byte) error {
|
||||
hashID := [32]byte{}
|
||||
copy(hashID[:], v)
|
||||
p.localsHistory.Add(hashID, struct{}{})
|
||||
return nil
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
txs := TxSlots{}
|
||||
parseCtx := NewTxParseContext()
|
||||
|
Loading…
Reference in New Issue
Block a user