From 4c73b58b834a841087f9f7528b4c2e8376245a86 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Apr 2017 23:21:53 +0300 Subject: [PATCH] Test --- src/wallet/wallet.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index d3ba06713..7f694fc5b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -786,7 +786,13 @@ void CWallet::DecrementNoteWitnesses(const CBlockIndex* pindex) } } fprintf(stderr,"decrement witness cache -> %d\n",(int32_t)nWitnessCacheSize); - nWitnessCacheSize -= 1; + if ( nWitnessCacheSize > 0 ) + nWitnessCacheSize -= 1; + else + { + extern char ASSETCHAINS_SYMBOL[16]; + fprintf(stderr,"%s nWitnessCacheSize.%d\n",ASSETCHAINS_SYMBOL,(int32_t)nWitnessCacheSize); + } for (std::pair& wtxItem : mapWallet) { for (mapNoteData_t::value_type& item : wtxItem.second.mapNoteData) { CNoteData* nd = &(item.second); @@ -805,11 +811,6 @@ void CWallet::DecrementNoteWitnesses(const CBlockIndex* pindex) } } } - if ( nWitnessCacheSize <= 0 ) - { - extern char ASSETCHAINS_SYMBOL[16]; - fprintf(stderr,"%s nWitnessCacheSize.%d\n",ASSETCHAINS_SYMBOL,(int32_t)nWitnessCacheSize); - } if ( KOMODO_REWIND == 0 ) assert(nWitnessCacheSize > 0); //if (fFileBacked) {