-
Notifications
You must be signed in to change notification settings - Fork 248
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
Prevent from completing tx multiple times #330
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
geth/node/txqueue.go
Outdated
ErrQueuedTxIDNotFound = errors.New("transaction hash not found") | ||
ErrQueuedTxTimedOut = errors.New("transaction sending timed out") | ||
ErrQueuedTxDiscarded = errors.New("transaction has been discarded") | ||
ErrQueuedTxInProgress = errors.New("transaction has started being processed already") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just "transaction is in progress"? "has started being processed already" seems a bit overcomplicated :)
geth/node/txqueue_manager.go
Outdated
@@ -188,6 +193,7 @@ func (m *TxQueueManager) completeLocalTransaction(queuedTx *common.QueuedTx, pas | |||
log.Info("complete transaction using local node", "id", queuedTx.ID) | |||
|
|||
les, err := m.nodeManager.LightEthereumService() | |||
log.Info("retrival les service", "err", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably unneeded already.
Transaction queue refactor issue #338. |
This PR prevents from completing (i.e. sending) the same transaction multiple times.
I successfully reproduced the bug described in #263 with a unit test. The problem was a missing guard which could prevent from using the same transaction in multiple
CompleteTransaction
calls.This is a quick solution but a well-though refactoring of
TxQueueManager
andTxQueue
is required. I will follow up with a separate issue regarding that.