X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fmain.h;h=4c4245439c1fc664a1d50b3efd98f4c2f93fa064;hp=dc8499a4b507a6a1971886102575fc9cb8327e8b;hb=273ceadcc0475b03a2be03ffbeded0831d8232fc;hpb=6a4bd809d3d79209ef43ee55304e744d23409582 diff --git a/src/main.h b/src/main.h index dc8499a..4c42454 100644 --- a/src/main.h +++ b/src/main.h @@ -44,6 +44,8 @@ static const int64 MIN_TXOUT_AMOUNT = CENT/100; inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } // Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp. static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC +// Maximum number of script-checking threads allowed +static const int MAX_SCRIPTCHECK_THREADS = 16; #ifdef USE_UPNP static const int fHaveUPnP = true; @@ -87,6 +89,7 @@ extern int64 nTransactionFee; extern int64 nMinimumInputValue; extern bool fUseFastIndex; extern unsigned int nDerivationMethodIndex; +extern int nScriptCheckThreads; // Minimum disk space required - used in CheckDiskSpace() static const uint64 nMinDiskSpace = 52428800; @@ -94,6 +97,7 @@ static const uint64 nMinDiskSpace = 52428800; class CReserveKey; class CTxDB; class CTxIndex; +class CScriptCheck; void RegisterWallet(CWallet* pwalletIn); void UnregisterWallet(CWallet* pwalletIn); @@ -109,6 +113,11 @@ bool ProcessMessages(CNode* pfrom); bool SendMessages(CNode* pto, bool fSendTrickle); bool LoadExternalBlockFile(FILE* fileIn); +// Run an instance of the script checking thread +void ThreadScriptCheck(void* parg); +// Stop the script checking threads +void ThreadScriptCheckQuit(); + bool CheckProofOfWork(uint256 hash, unsigned int nBits); unsigned int GetNextTargetRequired(const CBlockIndex* pindexLast, bool fProofOfStake); int64 GetProofOfWorkReward(unsigned int nBits, int64 nFees=0); @@ -695,7 +704,7 @@ public: */ bool ConnectInputs(CTxDB& txdb, MapPrevTx inputs, std::map& mapTestPool, const CDiskTxPos& posThisTx, - const CBlockIndex* pindexBlock, bool fBlock, bool fMiner, unsigned int flags=STANDARD_SCRIPT_VERIFY_FLAGS); + const CBlockIndex* pindexBlock, bool fBlock, bool fMiner, bool fScriptChecks=true, unsigned int flags=STANDARD_SCRIPT_VERIFY_FLAGS, std::vector *pvChecks = NULL); bool ClientConnectInputs(); bool CheckTransaction() const; bool AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs=true, bool* pfMissingInputs=NULL);