aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-01-20 17:07:40 -0500
committerGavin Andresen <gavinandresen@gmail.com>2012-01-20 17:07:40 -0500
commit137d0685a45d4a02f5773652130704ad135e63f7 (patch)
treeb28518fa3c67aebea8e9720a24661b6747fe524f /src/main.h
parent1240a1b0a82e0e944a6fdcf6ff26001e1bd68904 (diff)
downloadbitcoin-137d0685a45d4a02f5773652130704ad135e63f7.tar.xz
Simplify counting of P2SH sigops to match BIP 16 (thanks to Matt Corallo for prompting this).
This also removes an un-needed sigops-per-byte check when accepting transactions to the memory pool (un-needed assuming only standard transactions are being accepted). And it only counts P2SH sigops after the switchover date.
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.h b/src/main.h
index be5f2f58a5..6db9fc8053 100644
--- a/src/main.h
+++ b/src/main.h
@@ -528,14 +528,13 @@ public:
*/
int GetLegacySigOpCount() const;
- /** Count ECDSA signature operations the new (0.6-and-later) way
- This is a better measure of how expensive it is to process this transaction.
+ /** Count ECDSA signature operations in pay-to-script-hash inputs.
@param[in] mapInputs Map of previous transactions that have outputs we're spending
@return maximum number of sigops required to validate this transaction's inputs
@see CTransaction::FetchInputs
*/
- int GetSigOpCount(const MapPrevTx& mapInputs) const;
+ int GetP2SHSigOpCount(const MapPrevTx& mapInputs) const;
/** Amount of bitcoins spent by this transaction.
@return sum of all outputs (note: does not include fees)
@@ -698,11 +697,12 @@ public:
@param[in] pindexBlock
@param[in] fBlock true if called from ConnectBlock
@param[in] fMiner true if called from CreateNewBlock
+ @param[in] fStrictPayToScriptHash true if fully validating p2sh transactions
@return Returns true if all checks succeed
*/
bool ConnectInputs(MapPrevTx inputs,
std::map<uint256, CTxIndex>& mapTestPool, const CDiskTxPos& posThisTx,
- const CBlockIndex* pindexBlock, bool fBlock, bool fMiner);
+ const CBlockIndex* pindexBlock, bool fBlock, bool fMiner, bool fStrictPayToScriptHash=true);
bool ClientConnectInputs();
bool CheckTransaction() const;
bool AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs=true, bool* pfMissingInputs=NULL);