X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fwallet.cpp;h=d7a70fe5636dc465b536a42a6b4158072063e455;hb=a49927a46d578d142411c52b17c6f11bb19da03d;hp=6a2bf022bbf7ae26107f82b2c90ffa5426961dcc;hpb=ed6d0b5f852dc5f1c9407abecb5a9c6a7e42b4b2;p=novacoin.git diff --git a/src/wallet.cpp b/src/wallet.cpp index 6a2bf02..d7a70fe 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1,10 +1,12 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "db.h" +#include "wallet.h" +#include "walletdb.h" #include "crypter.h" +#include "ui_interface.h" using namespace std; @@ -240,7 +242,8 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) if (fFileBacked) { pwalletdbEncryption = new CWalletDB(strWalletFile); - pwalletdbEncryption->TxnBegin(); + if (!pwalletdbEncryption->TxnBegin()) + return false; pwalletdbEncryption->WriteMasterKey(nMasterKeyMaxID, kMasterKey); } @@ -1120,7 +1123,7 @@ bool CWallet::CreateTransaction(const vector >& vecSend, CW return false; // Limit size - unsigned int nBytes = ::GetSerializeSize(*(CTransaction*)&wtxNew, SER_NETWORK); + unsigned int nBytes = ::GetSerializeSize(*(CTransaction*)&wtxNew, SER_NETWORK, PROTOCOL_VERSION); if (nBytes >= MAX_BLOCK_SIZE_GEN/5) return false; dPriority /= nBytes; @@ -1389,8 +1392,8 @@ bool CWallet::TopUpKeyPool() CWalletDB walletdb(strWalletFile); // Top up key pool - int64 nTargetSize = max(GetArg("-keypool", 100), (int64)0); - while (setKeyPool.size() < nTargetSize+1) + unsigned int nTargetSize = max(GetArg("-keypool", 100), 0LL); + while (setKeyPool.size() < (nTargetSize + 1)) { int64 nEnd = 1; if (!setKeyPool.empty())