From a7f6d54571227ad42b03298289f9fb187d997034 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Fri, 27 Aug 2021 11:08:43 +0700 Subject: [PATCH] add state check assert routine --- txpool/fetch.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/txpool/fetch.go b/txpool/fetch.go index d2169d0f4..7c53e84f5 100644 --- a/txpool/fetch.go +++ b/txpool/fetch.go @@ -17,6 +17,7 @@ package txpool import ( + "bytes" "context" "errors" "fmt" @@ -315,6 +316,13 @@ func (f *Fetch) handleInboundMessage(ctx context.Context, req *sentry.InboundMes if len(txs.txs) == 0 { 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) default: //defer log.Info("dropped", "id", req.Id)