Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCI-268: fix error logging bug #8611

Merged
merged 2 commits into from
Mar 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions core/chains/evm/txmgr/orm.go
Original file line number Diff line number Diff line change
Expand Up @@ -1070,12 +1070,13 @@ func (o *orm) UpdateEthTxUnstartedToInProgress(etx *EthTx, attempt *EthTxAttempt
// the node crashed in the middle of the ProcessUnstartedEthTxs loop.
// It may or may not have been broadcast to an eth node.
func (o *orm) GetEthTxInProgress(fromAddress common.Address, qopts ...pg.QOpt) (etx *EthTx, err error) {
qq := o.q.WithOpts()
qq := o.q.WithOpts(qopts...)
etx = new(EthTx)
err = qq.Transaction(func(tx pg.Queryer) error {
err = qq.Get(etx, `SELECT * FROM eth_txes WHERE from_address = $1 and state = 'in_progress'`, fromAddress.Bytes())
if errors.Is(err, sql.ErrNoRows) {
return err
etx = nil
return nil
} else if err != nil {
return errors.Wrap(err, "GetEthTxInProgress failed while loading eth tx")
}
Expand All @@ -1089,10 +1090,6 @@ func (o *orm) GetEthTxInProgress(fromAddress common.Address, qopts ...pg.QOpt) (
return nil
})

if errors.Is(err, sql.ErrNoRows) {
return nil, nil
}

return etx, errors.Wrap(err, "getInProgressEthTx failed")
}

Expand Down