Merge pull request #203 from svost/C4245
authorCryptoManiac <CryptoManiac@users.noreply.github.com>
Tue, 14 Apr 2015 20:33:13 +0000 (23:33 +0300)
committerCryptoManiac <CryptoManiac@users.noreply.github.com>
Tue, 14 Apr 2015 20:33:13 +0000 (23:33 +0300)
Remove msvc C4245 warning, better readability.

src/serialize.h
src/wallet.cpp

index a1f8a0e..52328c3 100644 (file)
@@ -1106,10 +1106,7 @@ public:
         if (nReadPosNext >= vch.size())
         {
             if (nReadPosNext > vch.size())
-            {
                 setstate(std::ios::failbit, "CDataStream::ignore() : end of data");
-                nSize = (int)(vch.size() - nReadPos);
-            }
             nReadPos = 0;
             vch.clear();
             return (*this);
index b484fc2..88d661e 100644 (file)
@@ -1081,7 +1081,7 @@ void CWallet::ResendWalletTransactions()
 {
     // Do this infrequently and randomly to avoid giving away
     // that these are our transactions.
-    static int64_t nNextTime;
+    static int64_t nNextTime = GetRand(GetTime() + 30 * 60);
     if (GetTime() < nNextTime)
         return;
     bool fFirst = (nNextTime == 0);
@@ -1090,7 +1090,7 @@ void CWallet::ResendWalletTransactions()
         return;
 
     // Only do it if there's been a new block since last time
-    static int64_t nLastTime;
+    static int64_t nLastTime = 0;
     if (nTimeBestReceived < nLastTime)
         return;
     nLastTime = GetTime();