This commit is contained in:
jl777
2017-04-17 17:33:52 +03:00
parent bfb634f223
commit e9e7e410ef
2 changed files with 4 additions and 1 deletions

View File

@@ -635,6 +635,7 @@ void CWallet::ClearNoteWitnessCache()
} }
} }
nWitnessCacheSize = 0; nWitnessCacheSize = 0;
fprintf(stderr,"Clear witness cache\n");
} }
void CWallet::IncrementNoteWitnesses(const CBlockIndex* pindex, void CWallet::IncrementNoteWitnesses(const CBlockIndex* pindex,
@@ -669,6 +670,7 @@ void CWallet::IncrementNoteWitnesses(const CBlockIndex* pindex,
} }
} }
if (nWitnessCacheSize < WITNESS_CACHE_SIZE) { if (nWitnessCacheSize < WITNESS_CACHE_SIZE) {
fprintf(stderr,"increment nWitnesscache -> %d\n",(int32_t)nWitnessCacheSize);
nWitnessCacheSize += 1; nWitnessCacheSize += 1;
} }
@@ -782,6 +784,7 @@ void CWallet::DecrementNoteWitnesses(const CBlockIndex* pindex)
} }
} }
} }
fprintf(stderr,"decrement witness cache -> %d\n",(int32_t)nWitnessCacheSize);
nWitnessCacheSize -= 1; nWitnessCacheSize -= 1;
for (std::pair<const uint256, CWalletTx>& wtxItem : mapWallet) { for (std::pair<const uint256, CWalletTx>& wtxItem : mapWallet) {
for (mapNoteData_t::value_type& item : wtxItem.second.mapNoteData) { for (mapNoteData_t::value_type& item : wtxItem.second.mapNoteData) {

View File

@@ -59,7 +59,7 @@ static const unsigned int MAX_FREE_TRANSACTION_CREATE_SIZE = 1000;
// Should be large enough that we can expect not to reorg beyond our cache // Should be large enough that we can expect not to reorg beyond our cache
// unless there is some exceptional network disruption. // unless there is some exceptional network disruption.
#define _COINBASE_MATURITY 100 #define _COINBASE_MATURITY 100
static const unsigned int WITNESS_CACHE_SIZE = _COINBASE_MATURITY+2; static const unsigned int WITNESS_CACHE_SIZE = _COINBASE_MATURITY+10;
class CAccountingEntry; class CAccountingEntry;
class CBlockIndex; class CBlockIndex;