PPCoin: Fix CreateCoinStake() bug from 747f99fb
authorSunny King <sunnyking9999@gmail.com>
Thu, 19 Apr 2012 15:41:38 +0000 (16:41 +0100)
committerSunny King <sunnyking9999@gmail.com>
Thu, 19 Apr 2012 15:41:38 +0000 (16:41 +0100)
        causing SignSignature()'s first assert firing in script.cpp

src/wallet.cpp

index 58e1baf..1b30be8 100644 (file)
@@ -1114,7 +1114,7 @@ bool CWallet::CreateCoinStake(CScript scriptPubKey, unsigned int nBits, CTransac
                 break;
             }
         }
-        if (nCredit > nBalance - nBalanceReserve)
+        if (nCredit == 0 || nCredit > nBalance - nBalanceReserve)
             return false;
         // Calculate coin age reward
         {