mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
eth: return err if local tracker is not configured
This commit is contained in:
parent
c748bf6201
commit
df06cba97b
1 changed files with 6 additions and 2 deletions
|
|
@ -272,7 +272,8 @@ func (b *EthAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscri
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error {
|
func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error {
|
||||||
if locals := b.eth.localTxTracker; locals != nil {
|
locals := b.eth.localTxTracker
|
||||||
|
if locals != nil {
|
||||||
if err := locals.Track(signedTx); err != nil {
|
if err := locals.Track(signedTx); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -280,7 +281,10 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction)
|
||||||
// No error will be returned to user if the transaction fails stateful
|
// No error will be returned to user if the transaction fails stateful
|
||||||
// validation (e.g., no available slot), as the locally submitted transactions
|
// validation (e.g., no available slot), as the locally submitted transactions
|
||||||
// may be resubmitted later via the local tracker.
|
// may be resubmitted later via the local tracker.
|
||||||
b.eth.txPool.Add([]*types.Transaction{signedTx}, false)
|
err := b.eth.txPool.Add([]*types.Transaction{signedTx}, false)[0]
|
||||||
|
if err != nil && locals == nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue