using namespace std;
extern int nStakeMaxAge;
-
+extern unsigned int nTransactionsUpdated;
//////////////////////////////////////////////////////////////////////////////
//
return false;
vector<const CWalletTx*> vwtxPrev;
-
-/*
- * TODO: performance comparison
-
- static set<pair<const CWalletTx*,unsigned int> > setCoins;
- static uint256 hashPrevBlock;
- static int64 nValueIn = 0;
-
- // Cache outputs unless best block changed
- if (hashPrevBlock != pindexBest->GetBlockHash())
- {
- if (!SelectCoinsSimple(nBalance - nReserveBalance, GetAdjustedTime(), nCoinbaseMaturity * 10, setCoins, nValueIn))
- return false;
-
- if (setCoins.empty())
- return false;
-
- hashPrevBlock == pindexBest->GetBlockHash();
- }
-*/
-
set<pair<const CWalletTx*,unsigned int> > setCoins;
int64 nValueIn = 0;
// The following combine threshold is important to security
// Should not be adjusted if you don't understand the consequences
int64 nCombineThreshold = GetProofOfWorkReward(GetLastBlockIndex(pindexBest, false)->nBits) / 3;
-
+ CBlockIndex* pindexPrev = pindexBest;
CBigNum bnTargetPerCoinDay;
bnTargetPerCoinDay.SetCompact(nBits);
return false;
vector<const CWalletTx*> vwtxPrev;
-
-/*
- * TODO: performance comparison
-
- static set<pair<const CWalletTx*,unsigned int> > setCoins;
- static uint256 hashPrevBlock;
- static int64 nValueIn = 0;
-
- // Cache outputs unless best block changed
- if (hashPrevBlock != pindexBest->GetBlockHash())
- {
- if (!SelectCoinsSimple(nBalance - nReserveBalance, txNew.nTime, nCoinbaseMaturity * 10, setCoins, nValueIn))
- return false;
-
- if (setCoins.empty())
- return false;
-
- hashPrevBlock == pindexBest->GetBlockHash();
- }
-*/
-
set<pair<const CWalletTx*,unsigned int> > setCoins;
int64 nValueIn = 0;
bool fKernelFound = false;
- for (unsigned int n=0; n<min(nSearchInterval,(int64)nMaxStakeSearchInterval) && !fKernelFound && !fShutdown; n++)
+ for (unsigned int n=0; n<min(nSearchInterval,(int64)nMaxStakeSearchInterval) && !fKernelFound && !fShutdown && pindexPrev == pindexBest; n++)
{
// Search backward in time from the given txNew timestamp
// Search nSearchInterval seconds back up to nMaxStakeSearchInterval