Merge pull request #773 from gavinandresen/p2shSigOpCount

Simplify counting of P2SH sigops to match BIP 16
This commit is contained in:
Gavin Andresen
2012-01-25 05:21:20 -08:00
4 changed files with 53 additions and 52 deletions

View File

@@ -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)
@@ -699,11 +698,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);