add state check assert routine

This commit is contained in:
alex.sharov 2021-08-27 11:08:43 +07:00
parent 57e84d56c3
commit a7f6d54571

View File

@ -17,6 +17,7 @@
package txpool package txpool
import ( import (
"bytes"
"context" "context"
"errors" "errors"
"fmt" "fmt"
@ -315,6 +316,13 @@ func (f *Fetch) handleInboundMessage(ctx context.Context, req *sentry.InboundMes
if len(txs.txs) == 0 { if len(txs.txs) == 0 {
return nil return nil
} }
if ASSERT {
for i := 0; i < txs.senders.Len(); i++ {
if bytes.Equal(txs.senders.At(i), EmptyAddr[:]) {
panic("here")
}
}
}
return f.pool.OnNewTxs(ctx, f.coreDB, txs, f.senders) return f.pool.OnNewTxs(ctx, f.coreDB, txs, f.senders)
default: default:
//defer log.Info("dropped", "id", req.Id) //defer log.Info("dropped", "id", req.Id)