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

Don't overwrite validation state with corruption check #9511

Merged
merged 1 commit into from Jan 23, 2017

Conversation

@morcos
Copy link
Member

commented Jan 10, 2017

AcceptToMemoryPool has several classes of return false statements.

  • return state.Invalid or state.DoS directly itself
  • return false and set fMissingInputs (state is valid)
  • return false and state is set by failed CheckTransaction
  • return false and state is set by failed CheckInputs.

This commit patches the last case where the state variable was reused for additional calls to CheckInputs to identify witness stripping as cause of validation failure. After this commit, it should be the case that if !fMissingInputs, state is always Invalid if AcceptToMemoryPool returns false.

Don't overwrite validation state with corruption check
AcceptToMemoryPool has several classes of return false statements.
- return state.Invalid or state.DoS directly itself
- return false and set fMissingInputs (state is valid)
- return false and state is set by failed CheckTransaction
- return false and state is set by failed CheckInputs.

This commit patches the last case where the state variable was reused for additional calls to CheckInputs to identify witness stripping as cause of validation failure.  After this commit, it should be the case that if !fMissingInputs, state is always Invalid if AcceptToMemoryPool returns false.

@fanquake fanquake added the Validation label Jan 11, 2017

@sipa

This comment has been minimized.

Copy link
Member

commented Jan 11, 2017

utACK 116419e

@MarcoFalke

This comment has been minimized.

Copy link
Member

commented Jan 12, 2017

utACK 116419e

@luke-jr

This comment has been minimized.

Copy link
Member

commented Jan 20, 2017

utACK

@sipa sipa added the Bug label Jan 21, 2017

@sipa sipa added this to the 0.14.0 milestone Jan 21, 2017

@laanwj

This comment has been minimized.

Copy link
Member

commented Jan 23, 2017

utACK 116419e

@laanwj laanwj merged commit 116419e into bitcoin:master Jan 23, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
laanwj added a commit that referenced this pull request Jan 23, 2017
Merge #9511: Don't overwrite validation state with corruption check
116419e Don't overwrite validation state with corruption check (Alex Morcos)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.