mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-20 17:31:11 +00:00
add state check assert routine
This commit is contained in:
parent
72c61acd6f
commit
e53a079b6d
@ -224,6 +224,13 @@ func (sc *SendersCache) onNewTxs(tx kv.Tx, newTxs TxSlots) (cacheMisses map[uint
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if ASSERT {
|
||||
if len(cacheMisses) > 0 {
|
||||
for i, j := range cacheMisses {
|
||||
fmt.Printf("cache misses: %d,%x\n", i, j)
|
||||
}
|
||||
}
|
||||
}
|
||||
return cacheMisses, nil
|
||||
}
|
||||
func (sc *SendersCache) loadFromCore(coreTx kv.Tx, toLoad map[uint64]string) error {
|
||||
@ -233,6 +240,11 @@ func (sc *SendersCache) loadFromCore(coreTx kv.Tx, toLoad map[uint64]string) err
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if info == nil {
|
||||
if ASSERT {
|
||||
fmt.Printf("core returned nil: %d,%x\n", id, toLoad[id])
|
||||
}
|
||||
}
|
||||
diff[id] = info
|
||||
}
|
||||
sc.lock.Lock()
|
||||
@ -1135,15 +1147,6 @@ func (p *TxPool) flushLocked(tx kv.RwTx) (evicted uint64, err error) {
|
||||
}
|
||||
txs.txs[i].rlp = nil // means that we don't need store it in db anymore
|
||||
txs.txs[i].senderID = binary.BigEndian.Uint64(v)
|
||||
|
||||
//senderAddr, err := tx.GetOne(kv.PooledSenderIDToAdress, v[:8])
|
||||
//if err != nil {
|
||||
// return err
|
||||
//}
|
||||
//if len(senderAddr) == 0 {
|
||||
// panic("must not happen")
|
||||
//}
|
||||
//copy(txs.senders.At(i), senderAddr)
|
||||
//bkock num = binary.BigEndian.Uint64(v[8:])
|
||||
copy(hashID[:], k)
|
||||
_, isLocalTx := p.localsHistory.Get(hashID)
|
||||
|
Loading…
x
Reference in New Issue
Block a user