Merge branch '0.6.x' into 0.7.x

Conflicts:
	src/bitcoinrpc.cpp
	src/crypter.h
	src/main.cpp
	src/qt/bitcoin.cpp
	src/qt/qtipcserver.cpp
	src/util.cpp
This commit is contained in:
Luke Dashjr 2012-11-14 21:32:36 +00:00
commit c6911a9755
19 changed files with 32 additions and 39 deletions

View File

@ -17,6 +17,8 @@
#include <string>
#include <vector>
#include <openssl/crypto.h> // for OPENSSL_cleanse()
#include "bignum.h"
#include "key.h"
#include "script.h"
@ -190,7 +192,7 @@ protected:
{
// zero the memory, as it may contain sensitive data
if (!vchData.empty())
memset(&vchData[0], 0, vchData.size());
OPENSSL_cleanse(&vchData[0], vchData.size());
}
void SetData(int nVersionIn, const void* pdata, size_t nSize)
@ -221,7 +223,7 @@ public:
vchData.resize(vchTemp.size() - 1);
if (!vchData.empty())
memcpy(&vchData[0], &vchTemp[1], vchData.size());
memset(&vchTemp[0], 0, vchTemp.size());
OPENSSL_cleanse(&vchTemp[0], vchData.size());
return true;
}

View File

@ -24,8 +24,8 @@ bool CCrypter::SetKeyFromPassphrase(const SecureString& strKeyData, const std::v
if (i != (int)WALLET_CRYPTO_KEY_SIZE)
{
memset(&chKey, 0, sizeof chKey);
memset(&chIV, 0, sizeof chIV);
OPENSSL_cleanse(chKey, sizeof(chKey));
OPENSSL_cleanse(chIV, sizeof(chIV));
return false;
}

View File

@ -76,8 +76,8 @@ public:
void CleanKey()
{
memset(&chKey, 0, sizeof chKey);
memset(&chIV, 0, sizeof chIV);
OPENSSL_cleanse(chKey, sizeof(chKey));
OPENSSL_cleanse(chIV, sizeof(chIV));
fKeySet = false;
}

View File

@ -3461,7 +3461,6 @@ public:
CBlock* CreateNewBlock(CReserveKey& reservekey)
{
// Create new block
auto_ptr<CBlock> pblock(new CBlock());
if (!pblock.get())

View File

@ -548,7 +548,7 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest
void CNetAddr::Init()
{
memset(ip, 0, 16);
memset(ip, 0, sizeof(ip));
}
void CNetAddr::SetIP(const CNetAddr& ipIn)

View File

@ -82,4 +82,4 @@ signals:
void verifyMessage(QString addr);
};
#endif // ADDRESSBOOKDIALOG_H
#endif // ADDRESSBOOKPAGE_H

View File

@ -221,7 +221,7 @@ bool AskPassphraseDialog::event(QEvent *event)
return QWidget::event(event);
}
bool AskPassphraseDialog::eventFilter(QObject *, QEvent *event)
bool AskPassphraseDialog::eventFilter(QObject *object, QEvent *event)
{
/* Detect Caps Lock.
* There is no good OS-independent way to check a key state in Qt, but we
@ -244,5 +244,5 @@ bool AskPassphraseDialog::eventFilter(QObject *, QEvent *event)
}
}
}
return false;
return QDialog::eventFilter(object, event);
}

View File

@ -1,5 +1,5 @@
#ifndef BITCOINFIELD_H
#define BITCOINFIELD_H
#ifndef BITCOINAMOUNTFIELD_H
#define BITCOINAMOUNTFIELD_H
#include <QWidget>
@ -57,4 +57,4 @@ private slots:
};
#endif // BITCOINFIELD_H
#endif // BITCOINAMOUNTFIELD_H

View File

@ -622,11 +622,9 @@ void BitcoinGUI::closeEvent(QCloseEvent *event)
void BitcoinGUI::askFee(qint64 nFeeRequired, bool *payFee)
{
QString strMessage =
tr("This transaction is over the size limit. You can still send it for a fee of %1, "
"which goes to the nodes that process your transaction and helps to support the network. "
"Do you want to pay the fee?").arg(
BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nFeeRequired));
QString strMessage = tr("This transaction is over the size limit. You can still send it for a fee of %1, "
"which goes to the nodes that process your transaction and helps to support the network. "
"Do you want to pay the fee?").arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nFeeRequired));
QMessageBox::StandardButton retval = QMessageBox::question(
this, tr("Confirm transaction fee"), strMessage,
QMessageBox::Yes|QMessageBox::Cancel, QMessageBox::Yes);

View File

@ -176,4 +176,4 @@ private slots:
void toggleHidden();
};
#endif
#endif // BITCOINGUI_H

View File

@ -90,7 +90,7 @@
<item>
<widget class="QValidatedLineEdit" name="payTo">
<property name="toolTip">
<string>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</string>
<string>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</string>
</property>
<property name="maxLength">
<number>34</number>

View File

@ -1,7 +1,7 @@
#ifndef MACDOCKICONHANDLER_H
#define MACDOCKICONHANDLER_H
#include <QtCore/QObject>
#include <QObject>
class QMenu;
class QIcon;

View File

@ -26,7 +26,7 @@ using namespace boost;
using namespace boost::interprocess;
using namespace boost::posix_time;
#ifdef MAC_OSX
#if defined MAC_OSX || defined __FreeBSD__
// URI handling not implemented on OSX yet
void ipcScanRelay(int argc, char *argv[]) { }

View File

@ -81,5 +81,4 @@ public slots:
friend class TransactionTablePriv;
};
#endif
#endif // TRANSACTIONTABLEMODEL_H

View File

@ -1396,7 +1396,7 @@ Value encryptwallet(const Array& params, bool fHelp)
// slack space in .dat files; that is bad if the old data is
// unencrypted private keys. So:
StartShutdown();
return "wallet encrypted; Bitcoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.";
return "wallet encrypted; Bitcoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.";
}
class DescribeAddressVisitor : public boost::static_visitor<Object>

View File

@ -14,6 +14,8 @@
#include <cstring>
#include <cstdio>
#include <openssl/crypto.h> // for OPENSSL_cleanse()
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>

View File

@ -22,14 +22,7 @@ createArgs(int nRequired, const char* address1=NULL, const char* address2=NULL)
return result;
}
// This can be removed this when addmultisigaddress is enabled on main net:
struct TestNetFixture
{
TestNetFixture() { fTestNet = true; }
~TestNetFixture() { fTestNet = false; }
};
BOOST_FIXTURE_TEST_CASE(rpc_addmultisig, TestNetFixture)
BOOST_AUTO_TEST_CASE(rpc_addmultisig)
{
rpcfn_type addmultisig = tableRPC["addmultisigaddress"]->actor;

View File

@ -155,7 +155,7 @@ void RandAddSeedPerfmon()
if (ret == ERROR_SUCCESS)
{
RAND_add(pdata, nSize, nSize/100.0);
memset(pdata, 0, nSize);
OPENSSL_cleanse(pdata, nSize);
printf("RandAddSeed() %lu bytes\n", nSize);
}
#endif

View File

@ -1329,7 +1329,7 @@ string CWallet::SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew,
if (IsLocked())
{
string strError = _("Error: Wallet locked, unable to create transaction ");
string strError = _("Error: Wallet locked, unable to create transaction.");
printf("SendMoney() : %s", strError.c_str());
return strError;
}
@ -1337,9 +1337,9 @@ string CWallet::SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew,
{
string strError;
if (nValue + nFeeRequired > GetBalance())
strError = strprintf(_("Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "), FormatMoney(nFeeRequired).c_str());
strError = strprintf(_("Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds."), FormatMoney(nFeeRequired).c_str());
else
strError = _("Error: Transaction creation failed ");
strError = _("Error: Transaction creation failed.");
printf("SendMoney() : %s", strError.c_str());
return strError;
}
@ -1348,7 +1348,7 @@ string CWallet::SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew,
return "ABORTED";
if (!CommitTransaction(wtxNew, reservekey))
return _("Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.");
return _("Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.");
return "";
}