Skip to content

Commit

Permalink
txpool-respect-parse-transaction-result (#1103)
Browse files Browse the repository at this point in the history
  • Loading branch information
kstoykov authored Sep 4, 2024
1 parent f911a0d commit 3386925
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions zk/txpool/txpool_grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,11 @@ func (s *GrpcServer) Add(ctx context.Context, in *txpool_proto.AddRequest) (*txp

j := 0
for i := 0; i < len(in.RlpTxs); i++ { // some incoming txs may be rejected, so - need secnod index
slots.Resize(uint(j + 1))
slots.Txs[j] = &types.TxSlot{}
slots.IsLocal[j] = true
if _, err := parseCtx.ParseTransaction(in.RlpTxs[i], 0, slots.Txs[j], slots.Senders.At(j), false /* hasEnvelope */, func(hash []byte) error {
txSlot := &types.TxSlot{}
sender := common.Address{}
senderSlice := sender[:]

if _, err := parseCtx.ParseTransaction(in.RlpTxs[i], 0, txSlot, senderSlice, false /* hasEnvelope */, func(hash []byte) error {
if known, _ := s.txPool.IdHashKnown(tx, hash); known {
return types.ErrAlreadyKnown
}
Expand All @@ -208,6 +209,11 @@ func (s *GrpcServer) Add(ctx context.Context, in *txpool_proto.AddRequest) (*txp
}
continue
}

slots.Resize(uint(j + 1))
slots.Txs[j] = txSlot
copy(slots.Senders.At(j), senderSlice)
slots.IsLocal[j] = true
j++
}

Expand Down

0 comments on commit 3386925

Please sign in to comment.