mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-09 12:31:21 +00:00
add state check assert routine
This commit is contained in:
parent
a041261237
commit
8dd3f3c80e
@ -644,8 +644,10 @@ func (sc *SendersCache) flush(tx kv.RwTx, byNonce *ByNonce, sendersWithoutTransa
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if len(vv) == 0 {
|
if len(vv) == 0 {
|
||||||
tx.ForEach(kv.PooledSenderIDToAdress, nil, func(k, v []byte) error {
|
tx.ForEach(kv.PooledSenderIDToAdress, nil, func(k, vvvv []byte) error {
|
||||||
fmt.Printf("found:%x,%x\n", k, v)
|
if bytes.HasPrefix(k, v[:7]) {
|
||||||
|
fmt.Printf("found:%x,%x\n", k, vvvv)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
fmt.Printf("aa: %x,%x,%x\n", k, v, vv)
|
fmt.Printf("aa: %x,%x,%x\n", k, v, vv)
|
||||||
@ -674,6 +676,25 @@ func (sc *SendersCache) flush(tx kv.RwTx, byNonce *ByNonce, sendersWithoutTransa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sc.senderInfo = map[uint64]*senderInfo{}
|
sc.senderInfo = map[uint64]*senderInfo{}
|
||||||
|
if ASSERT {
|
||||||
|
tx.ForEach(kv.PooledTransaction, nil, func(k, v []byte) error {
|
||||||
|
vv, err := tx.GetOne(kv.PooledSenderIDToAdress, v[:8])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if len(vv) == 0 {
|
||||||
|
tx.ForEach(kv.PooledSenderIDToAdress, nil, func(k, vvvv []byte) error {
|
||||||
|
if bytes.HasPrefix(k, v[:7]) {
|
||||||
|
fmt.Printf("found:%x,%x\n", k, vvvv)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
fmt.Printf("aa: %x,%x,%x\n", k, v, vv)
|
||||||
|
panic("no-no")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
binary.BigEndian.PutUint64(encID, sc.blockHeight.Load())
|
binary.BigEndian.PutUint64(encID, sc.blockHeight.Load())
|
||||||
if err := tx.Put(kv.PoolInfo, SenderCacheHeightKey, encID); err != nil {
|
if err := tx.Put(kv.PoolInfo, SenderCacheHeightKey, encID); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user