aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-12-20 14:43:31 -0500
committerGavin Andresen <gavinandresen@gmail.com>2011-12-20 14:43:31 -0500
commit595925592d36fb5d5d34beea3c3e71fca2b6726e (patch)
treee28c34353aa08a6f3c0368a39982970c08245ea3 /src/main.h
parentf06e3e0ea6c8da90585a9f0936c390659dcece37 (diff)
parent77f21f1583deb89bf3fffe80fe9b181fedb1dd60 (diff)
downloadbitcoin-595925592d36fb5d5d34beea3c3e71fca2b6726e.tar.xz
Merge branch 'op_eval'
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h38
1 files changed, 9 insertions, 29 deletions
diff --git a/src/main.h b/src/main.h
index 67524ef4be..4543065d72 100644
--- a/src/main.h
+++ b/src/main.h
@@ -493,26 +493,8 @@ public:
return (vin.size() == 1 && vin[0].prevout.IsNull());
}
- int GetSigOpCount() const
- {
- int n = 0;
- BOOST_FOREACH(const CTxIn& txin, vin)
- n += txin.scriptSig.GetSigOpCount();
- BOOST_FOREACH(const CTxOut& txout, vout)
- n += txout.scriptPubKey.GetSigOpCount();
- return n;
- }
-
- bool IsStandard() const
- {
- BOOST_FOREACH(const CTxIn& txin, vin)
- if (!txin.scriptSig.IsPushOnly())
- return error("nonstandard txin: %s", txin.scriptSig.ToString().c_str());
- BOOST_FOREACH(const CTxOut& txout, vout)
- if (!::IsStandard(txout.scriptPubKey))
- return error("nonstandard txout: %s", txout.scriptPubKey.ToString().c_str());
- return true;
- }
+ bool IsStandard() const;
+ bool AreInputsStandard(std::map<uint256, std::pair<CTxIndex, CTransaction> > mapInputs) const;
int64 GetValueOut() const
{
@@ -640,8 +622,13 @@ public:
bool ReadFromDisk(CTxDB& txdb, COutPoint prevout);
bool ReadFromDisk(COutPoint prevout);
bool DisconnectInputs(CTxDB& txdb);
- bool ConnectInputs(CTxDB& txdb, std::map<uint256, CTxIndex>& mapTestPool, CDiskTxPos posThisTx,
- CBlockIndex* pindexBlock, int64& nFees, bool fBlock, bool fMiner, int64 nMinFee=0);
+
+ // Fetch from memory and/or disk. inputsRet keys are transaction hashes.
+ bool FetchInputs(CTxDB& txdb, const std::map<uint256, CTxIndex>& mapTestPool,
+ bool fBlock, bool fMiner, std::map<uint256, std::pair<CTxIndex, CTransaction> >& inputsRet);
+ bool ConnectInputs(std::map<uint256, std::pair<CTxIndex, CTransaction> > inputs,
+ std::map<uint256, CTxIndex>& mapTestPool, CDiskTxPos posThisTx,
+ CBlockIndex* pindexBlock, int64& nFees, bool fBlock, bool fMiner, int& nSigOpsRet, int64 nMinFee=0);
bool ClientConnectInputs();
bool CheckTransaction() const;
bool AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs=true, bool* pfMissingInputs=NULL);
@@ -851,13 +838,6 @@ public:
return (int64)nTime;
}
- int GetSigOpCount() const
- {
- int n = 0;
- BOOST_FOREACH(const CTransaction& tx, vtx)
- n += tx.GetSigOpCount();
- return n;
- }
uint256 BuildMerkleTree() const