mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-08 03:51:20 +00:00
add state check assert routine
This commit is contained in:
parent
3d5b89c4b9
commit
adaa3bb2ff
@ -1782,7 +1782,7 @@ func BroadcastLoop(ctx context.Context, db kv.RwDB, coreDB kv.RoDB, p *TxPool, s
|
|||||||
if ASSERT {
|
if ASSERT {
|
||||||
go func() {
|
go func() {
|
||||||
if err := p.forceCheckState(ctx, db, coreDB); err != nil {
|
if err := p.forceCheckState(ctx, db, coreDB); err != nil {
|
||||||
log.Error("restore from db", "err", err)
|
log.Error("forceCheckState", "err", err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
@ -1866,6 +1866,12 @@ func (p *TxPool) forceCheckState(ctx context.Context, db, coreDB kv.RoDB) error
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if v2 == nil {
|
||||||
|
// for now skip this case because we do create
|
||||||
|
// account with 0 nonce and 0 balance for unknown senders (because
|
||||||
|
// they may become known in near future)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if !bytes.Equal(v, v2) {
|
if !bytes.Equal(v, v2) {
|
||||||
return fmt.Errorf("state check failed: key=%x, local value=%x, remote value=%x\n", k, v, v2)
|
return fmt.Errorf("state check failed: key=%x, local value=%x, remote value=%x\n", k, v, v2)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user