Skip to content

Commit c5d04d6

Browse files
committed
eth: return err if local tracker is not configured
1 parent 159ee7d commit c5d04d6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

eth/api_backend.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,19 @@ func (b *EthAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscri
272272
}
273273

274274
func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error {
275-
if locals := b.eth.localTxTracker; locals != nil {
275+
locals := b.eth.localTxTracker
276+
if locals != nil {
276277
if err := locals.Track(signedTx); err != nil {
277278
return err
278279
}
279280
}
280281
// No error will be returned to user if the transaction fails stateful
281282
// validation (e.g., no available slot), as the locally submitted transactions
282283
// may be resubmitted later via the local tracker.
283-
b.eth.txPool.Add([]*types.Transaction{signedTx}, false)
284+
err := b.eth.txPool.Add([]*types.Transaction{signedTx}, false)[0]
285+
if err != nil && locals == nil {
286+
return err
287+
}
284288
return nil
285289
}
286290

0 commit comments

Comments
 (0)