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

Separate Consensus::CheckTxInputs and GetSpendHeight in CheckInputs #6061

Merged
merged 1 commit into from Jun 10, 2015

Conversation

Projects
None yet
3 participants
@jtimon
Member

jtimon commented Apr 25, 2015

A simple refactor as preparation for moving consensus to code for transaction validation.

Consensus shouldn't depend on std::vector<CScriptCheck> *pvChecks.

This is part of #6051 but can be merged independently.

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Apr 28, 2015

Member

Code change looks good to me, but why is CheckInputs not consensus, while CheckTxInputs is?

Member

sipa commented Apr 28, 2015

Code change looks good to me, but why is CheckInputs not consensus, while CheckTxInputs is?

@jtimon

This comment has been minimized.

Show comment
Hide comment
@jtimon

jtimon Apr 28, 2015

Member

CheckInputs uses the CScriptCheck class which consensus doesn't need. I later plan to create Consensus::CheckTxInputsScripts that does the remaining and it's used directly instead of CheckInputs in some places (in miner and AcceptToMemPool, but not in AcceptBlock).
The following branch is outdated, but you can get an idea here jtimon@ddd505a

Member

jtimon commented Apr 28, 2015

CheckInputs uses the CScriptCheck class which consensus doesn't need. I later plan to create Consensus::CheckTxInputsScripts that does the remaining and it's used directly instead of CheckInputs in some places (in miner and AcceptToMemPool, but not in AcceptBlock).
The following branch is outdated, but you can get an idea here jtimon@ddd505a

@laanwj laanwj added the Refactoring label May 12, 2015

Show outdated Hide outdated src/main.h
@@ -507,4 +507,10 @@ extern CCoinsViewCache *pcoinsTip;
/** Global variable that points to the active block tree (protected by cs_main) */
extern CBlockTreeDB *pblocktree;
/**
* While checking, GetBestBlock() refers to the parent block. (protected by cs_main)

This comment has been minimized.

@laanwj

laanwj Jun 10, 2015

Member

This comment does not actually describe what the function does :)

@laanwj

laanwj Jun 10, 2015

Member

This comment does not actually describe what the function does :)

This comment has been minimized.

@jtimon

jtimon Jun 10, 2015

Member

Yeah, I just moved the comments from the cpp instead of moving the implementation of the new function. I've just added a line to the doc. Should I leave the rest here or move it back to the implementation?

@jtimon

jtimon Jun 10, 2015

Member

Yeah, I just moved the comments from the cpp instead of moving the implementation of the new function. I've just added a line to the doc. Should I leave the rest here or move it back to the implementation?

@jtimon

This comment has been minimized.

Show comment
Hide comment
@jtimon

jtimon Jun 10, 2015

Member

By the way, @laanwj (or anyone) feel free to propose additional edits to GetSpendHeight's documentation.

Member

jtimon commented Jun 10, 2015

By the way, @laanwj (or anyone) feel free to propose additional edits to GetSpendHeight's documentation.

@laanwj laanwj merged commit eb83719 into bitcoin:master Jun 10, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Jun 10, 2015

Member

ACK

Member

laanwj commented Jun 10, 2015

ACK

laanwj added a commit that referenced this pull request Jun 10, 2015

Merge pull request #6061
eb83719 Consensus: Refactor: Separate Consensus::CheckTxInputs and GetSpendHeight in CheckInputs (Jorge Timón)

@str4d str4d referenced this pull request Feb 14, 2017

Merged

Bitcoin 0.12 misc PRs 1 #2099

@dagurval dagurval referenced this pull request Mar 19, 2018

Merged

Precompute sighashes #366

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment