Skip to content

core: fix panic when stat-ing a tx from a queue-only account#15714

Merged
karalabe merged 1 commit into
ethereum:masterfrom
karalabe:txpool-status-crash
Dec 20, 2017
Merged

core: fix panic when stat-ing a tx from a queue-only account#15714
karalabe merged 1 commit into
ethereum:masterfrom
karalabe:txpool-status-crash

Conversation

@karalabe
Copy link
Copy Markdown
Member

Fixes #15711.

The light client has a functionality to request the txpool status of a transaction (unknown, pending, queued). This operates by looking up the transaction, and if it's known by the pool (contained in pool.all), it checks whether it's in pool.pending[from] or not.

However, pool.pending[from] might be nil if the account only has queued transactions, but no pending ones. In that case, the code crashed. This PR fixes is so that if pool.pending[from] is nil, the transaction is immediately assumed to be queued, and not explicitly checked further.

@karalabe karalabe requested a review from holiman as a code owner December 20, 2017 10:14
Copy link
Copy Markdown
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@zsfelfoldi zsfelfoldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@karalabe karalabe added this to the 1.8.0 milestone Dec 20, 2017
@karalabe karalabe merged commit 5e1581c into ethereum:master Dec 20, 2017
b00ris pushed a commit to b00ris/go-ethereum that referenced this pull request Jan 19, 2018
mariameda pushed a commit to NiluPlatform/go-nilu that referenced this pull request Aug 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two separate main-net Geth nodes (v1.8.0-unstable-c6069a62) crashed on the same block number

3 participants