Merge branch '0.6.0.x' into 0.6.x

Conflicts:
	contrib/debian/patches/1001_use_system_json-spirit.patch
	src/key.h
	src/main.cpp
	src/main.h
	src/net.cpp
This commit is contained in:
Luke Dashjr
2012-07-06 00:54:24 +00:00
29 changed files with 130 additions and 55 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
Building Bitcoin
See doc/readme-qt.rst for instructions on building Bitcoin QT,
See doc/readme-qt.rst for instructions on building Bitcoin-Qt,
the intended-for-end-users, nice-graphical-interface, reference
implementation of Bitcoin.
See doc/build-*.txt for instructions on building bitcoind,
the intended-for-services, no-graphical-interface, reference
implementation of Bitcoin.
implementation of Bitcoin.
+4 -4
View File
@@ -5,15 +5,15 @@ INCLUDEPATH += src src/json src/qt
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
CONFIG += no_include_pwd
# for boost 1.37, add -mt to the boost libraries
# for boost 1.37, add -mt to the boost libraries
# use: qmake BOOST_LIB_SUFFIX=-mt
# for boost thread win32 with _win32 sufix
# use: BOOST_THREAD_LIB_SUFFIX=_win32-...
# or when linking against a specific BerkelyDB version: BDB_LIB_SUFFIX=-4.8
# Dependency library locations can be customized with BOOST_INCLUDE_PATH,
# BOOST_LIB_PATH, BDB_INCLUDE_PATH, BDB_LIB_PATH
# OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively
# Dependency library locations can be customized with:
# BOOST_INCLUDE_PATH, BOOST_LIB_PATH, BDB_INCLUDE_PATH,
# BDB_LIB_PATH, OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively
OBJECTS_DIR = build
MOC_DIR = build
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -7,7 +7,7 @@ cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP
software written by Thomas Bernard.
See readme-qt.rst for instructions on building Bitcoin QT, the
See readme-qt.rst for instructions on building Bitcoin-Qt, the
graphical user interface.
WINDOWS BUILD NOTES
+1 -1
View File
@@ -12,7 +12,7 @@ Laszlo Hanyecz <solar@heliacal.net>
Douglas Huff <dhuff@jrbobdobbs.org>
See readme-qt.rst for instructions on building Bitcoin QT, the
See readme-qt.rst for instructions on building Bitcoin-Qt, the
graphical user interface.
Tested on 10.5 and 10.6 intel. PPC is not supported because it's big-endian.
+2 -2
View File
@@ -16,8 +16,8 @@ To Build
cd src/
make -f makefile.unix # Headless bitcoin
See readme-qt.rst for instructions on building Bitcoin QT,
the graphical bitcoin.
See readme-qt.rst for instructions on building Bitcoin-Qt,
the graphical user interface.
Dependencies
------------
+33
View File
@@ -0,0 +1,33 @@
Compiling/runing bitcoind unit tests
------------------------------------
bitcoind unit tests are in the src/test/ directory; they
use the Boost::Test unit-testing framework.
To compile and run the tests:
cd src
make -f makefile.unix test_bitcoin # Replace makefile.unix if you're not on unix
./test_bitcoin # Runs the unit tests
If all tests succeed the last line of output will be:
*** No errors detected
To add more tests, add BOOST_AUTO_TEST_CASE's to the existing
.cpp files in the test/ directory or add new .cpp files that
implement new BOOST_AUTO_TEST_SUITE's (the makefiles are
set up to add test/*.cpp to test_bitcoin automatically).
Compiling/running Bitcoin-Qt unit tests
---------------------------------------
Bitcoin-Qt unit tests are in the src/qt/test/ directory; they
use the Qt unit-testing framework.
To compile and run the tests:
qmake bitcoin-qt.pro BITCOIN_QT_TEST=1
make
./bitcoin-qt_test
To add more tests, add them to the src/qt/test/ directory,
the src/qt/test/test_main.cpp file, and bitcoin-qt.pro.
+2 -2
View File
@@ -22,13 +22,13 @@ private:
// where knowledge about this address first came from
CNetAddr source;
// last succesfull connection by us
// last successful connection by us
int64 nLastSuccess;
// last try whatsoever by us:
// int64 CAddress::nLastTry
// connection attempts since last succesful attempt
// connection attempts since last successful attempt
int nAttempts;
// reference count in new sets (memory only)
+4 -4
View File
@@ -70,7 +70,7 @@ inline std::string EncodeBase58(const std::vector<unsigned char>& vch)
}
// Decode a base58-encoded string psz into byte vector vchRet
// returns true if decoding is succesful
// returns true if decoding is successful
inline bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet)
{
CAutoBN_CTX pctx;
@@ -118,7 +118,7 @@ inline bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet)
}
// Decode a base58-encoded string str into byte vector vchRet
// returns true if decoding is succesful
// returns true if decoding is successful
inline bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet)
{
return DecodeBase58(str.c_str(), vchRet);
@@ -138,7 +138,7 @@ inline std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn)
}
// Decode a base58-encoded string psz that includes a checksum, into byte vector vchRet
// returns true if decoding is succesful
// returns true if decoding is successful
inline bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet)
{
if (!DecodeBase58(psz, vchRet))
@@ -159,7 +159,7 @@ inline bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRe
}
// Decode a base58-encoded string str that includes a checksum, into byte vector vchRet
// returns true if decoding is succesful
// returns true if decoding is successful
inline bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet)
{
return DecodeBase58Check(str.c_str(), vchRet);
+11 -5
View File
@@ -122,16 +122,22 @@ public:
return (n > (unsigned long)std::numeric_limits<int>::max() ? std::numeric_limits<int>::min() : -(int)n);
}
void setint64(int64 n)
void setint64(int64 sn)
{
unsigned char pch[sizeof(n) + 6];
unsigned char pch[sizeof(sn) + 6];
unsigned char* p = pch + 4;
bool fNegative = false;
if (n < (int64)0)
bool fNegative;
uint64 n;
if (sn < (int64)0)
{
n = -n;
n = -sn;
fNegative = true;
} else {
n = sn;
fNegative = false;
}
bool fLeadingZeroes = true;
for (int i = 0; i < 8; i++)
{
+1 -1
View File
@@ -407,7 +407,7 @@ bool AppInit2(int argc, char* argv[])
if (GetBoolArg("-upgradewallet", fFirstRun))
{
int nMaxVersion = GetArg("-upgradewallet", 0);
if (nMaxVersion == 0) // the -walletupgrade without argument case
if (nMaxVersion == 0) // the -upgradewallet without argument case
{
printf("Performing wallet upgrade to %i\n", FEATURE_LATEST);
nMaxVersion = CLIENT_VERSION;
+1 -1
View File
@@ -187,7 +187,7 @@ MainOptionsPage::MainOptionsPage(QWidget *parent):
layout->addWidget(map_port_upnp);
connect_socks4 = new QCheckBox(tr("&Connect through SOCKS4 proxy:"));
connect_socks4->setToolTip(tr("Connect to the Bitcon network through a SOCKS4 proxy (e.g. when connecting through Tor)"));
connect_socks4->setToolTip(tr("Connect to the Bitcoin network through a SOCKS4 proxy (e.g. when connecting through Tor)"));
layout->addWidget(connect_socks4);
QHBoxLayout *proxy_hbox = new QHBoxLayout();
+1 -1
View File
@@ -22,7 +22,7 @@ public:
MinimizeOnClose, // bool
ConnectSOCKS4, // bool
ProxyIP, // QString
ProxyPort, // QString
ProxyPort, // int
Fee, // qint64
DisplayUnit, // BitcoinUnits::Unit
DisplayAddresses, // bool
+19 -13
View File
@@ -143,7 +143,7 @@ void OverviewPage::setNumTransactions(int count)
void OverviewPage::setModel(WalletModel *model)
{
this->model = model;
if(model)
if(model && model->getOptionsModel())
{
// Set up transaction list
TransactionFilterProxy *filter = new TransactionFilterProxy();
@@ -163,17 +163,23 @@ void OverviewPage::setModel(WalletModel *model)
setNumTransactions(model->getNumTransactions());
connect(model, SIGNAL(numTransactionsChanged(int)), this, SLOT(setNumTransactions(int)));
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(displayUnitChanged()));
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
}
// update the display unit, to not use the default ("BTC")
updateDisplayUnit();
}
void OverviewPage::updateDisplayUnit()
{
if(model && model->getOptionsModel())
{
if(currentBalance != -1)
setBalance(currentBalance, currentUnconfirmedBalance);
// Update txdelegate->unit with the current unit
txdelegate->unit = model->getOptionsModel()->getDisplayUnit();
ui->listTransactions->update();
}
}
void OverviewPage::displayUnitChanged()
{
if(!model || !model->getOptionsModel())
return;
if(currentBalance != -1)
setBalance(currentBalance, currentUnconfirmedBalance);
txdelegate->unit = model->getOptionsModel()->getDisplayUnit();
ui->listTransactions->update();
}
+1 -1
View File
@@ -40,7 +40,7 @@ private:
TxViewDelegate *txdelegate;
private slots:
void displayUnitChanged();
void updateDisplayUnit();
};
#endif // OVERVIEWPAGE_H
+12 -2
View File
@@ -46,10 +46,11 @@ void SendCoinsDialog::setModel(WalletModel *model)
entry->setModel(model);
}
}
if(model)
if(model && model->getOptionsModel())
{
setBalance(model->getBalance(), model->getUnconfirmedBalance());
connect(model, SIGNAL(balanceChanged(qint64, qint64)), this, SLOT(setBalance(qint64, qint64)));
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
}
}
@@ -202,7 +203,7 @@ SendCoinsEntry *SendCoinsDialog::addEntry()
ui->scrollAreaWidgetContents->resize(ui->scrollAreaWidgetContents->sizeHint());
QCoreApplication::instance()->processEvents();
QScrollBar* bar = ui->scrollArea->verticalScrollBar();
if (bar)
if(bar)
bar->setSliderPosition(bar->maximum());
return entry;
}
@@ -286,3 +287,12 @@ void SendCoinsDialog::setBalance(qint64 balance, qint64 unconfirmedBalance)
int unit = model->getOptionsModel()->getDisplayUnit();
ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balance));
}
void SendCoinsDialog::updateDisplayUnit()
{
if(model && model->getOptionsModel())
{
// Update labelBalance with the current balance and the current unit
ui->labelBalance->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), model->getBalance()));
}
}
+1 -1
View File
@@ -47,8 +47,8 @@ private:
private slots:
void on_sendButton_clicked();
void removeEntry(SendCoinsEntry* entry);
void updateDisplayUnit();
};
#endif // SENDCOINSDIALOG_H
+14 -4
View File
@@ -68,6 +68,10 @@ void SendCoinsEntry::on_payTo_textChanged(const QString &address)
void SendCoinsEntry::setModel(WalletModel *model)
{
this->model = model;
if(model && model->getOptionsModel())
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
clear();
}
@@ -82,10 +86,8 @@ void SendCoinsEntry::clear()
ui->addAsLabel->clear();
ui->payAmount->clear();
ui->payTo->setFocus();
if(model && model->getOptionsModel())
{
ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
}
// update the display unit, to not use the default ("BTC")
updateDisplayUnit();
}
void SendCoinsEntry::on_deleteButton_clicked()
@@ -160,3 +162,11 @@ void SendCoinsEntry::setFocus()
ui->payTo->setFocus();
}
void SendCoinsEntry::updateDisplayUnit()
{
if(model && model->getOptionsModel())
{
// Update payAmount with the current unit
ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
}
}
+1
View File
@@ -45,6 +45,7 @@ private slots:
void on_payTo_textChanged(const QString &address);
void on_addressBookButton_clicked();
void on_pasteButton_clicked();
void updateDisplayUnit();
private:
Ui::SendCoinsEntry *ui;
+1 -1
View File
@@ -59,7 +59,7 @@ void URITests::uriTests()
QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W"));
QVERIFY(rv.label == QString());
// We currently dont implement the message paramenter (ok, yea, we break spec...)
// We currently don't implement the message parameter (ok, yea, we break spec...)
uri.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?req-message=Wikipedia Example Address"));
QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
+7
View File
@@ -218,6 +218,8 @@ TransactionTableModel::TransactionTableModel(CWallet* wallet, WalletModel *paren
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(MODEL_UPDATE_DELAY);
connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
}
TransactionTableModel::~TransactionTableModel()
@@ -619,3 +621,8 @@ QModelIndex TransactionTableModel::index(int row, int column, const QModelIndex
}
}
void TransactionTableModel::updateDisplayUnit()
{
// emit dataChanged to update Amount column with the current unit
emit dataChanged(index(0, Amount), index(priv->size()-1, Amount));
}
+2
View File
@@ -74,6 +74,8 @@ private:
private slots:
void update();
public slots:
void updateDisplayUnit();
friend class TransactionTablePriv;
};
+1 -1
View File
@@ -71,7 +71,7 @@ int static permute(int n)
return ret;
}
// Test that an mruset acts like a moving window, if no duplcate elements are added
// Test that an mruset acts like a moving window, if no duplicate elements are added
BOOST_AUTO_TEST_CASE(mruset_window)
{
mruset<int> mru(MAX_SIZE);
+1 -1
View File
@@ -235,7 +235,7 @@ BOOST_AUTO_TEST_CASE(multisig_Solver1)
BOOST_CHECK(ExtractAddresses(s, whichType, addrs, nRequired));
BOOST_CHECK(addrs[0] == keyaddr[0]);
BOOST_CHECK(addrs[1] == keyaddr[1]);
BOOST_CHECK(nRequired = 1);
BOOST_CHECK(nRequired == 1);
BOOST_CHECK(IsMine(keystore, s));
BOOST_CHECK(!IsMine(emptykeystore, s));
BOOST_CHECK(!IsMine(partialkeystore, s));
+3 -3
View File
@@ -34,9 +34,9 @@ BOOST_FIXTURE_TEST_CASE(rpc_addmultisig, TestNetFixture)
rpcfn_type addmultisig = tableRPC["addmultisigaddress"]->actor;
// old, 65-byte-long:
const char* address1Hex = "0434e3e09f49ea168c5bbf53f877ff4206923858aab7c7e1df25bc263978107c95e35065a27ef6f1b27222db0ec97e0e895eaca603d3ee0d4c060ce3d8a00286c8";
const char address1Hex[] = "0434e3e09f49ea168c5bbf53f877ff4206923858aab7c7e1df25bc263978107c95e35065a27ef6f1b27222db0ec97e0e895eaca603d3ee0d4c060ce3d8a00286c8";
// new, compressed:
const char* address2Hex = "0388c2037017c62240b6b72ac1a2a5f94da790596ebd06177c8572752922165cb4";
const char address2Hex[] = "0388c2037017c62240b6b72ac1a2a5f94da790596ebd06177c8572752922165cb4";
Value v;
CBitcoinAddress address;
@@ -62,7 +62,7 @@ BOOST_FIXTURE_TEST_CASE(rpc_addmultisig, TestNetFixture)
string short1(address1Hex, address1Hex+sizeof(address1Hex)-2); // last byte missing
BOOST_CHECK_THROW(addmultisig(createArgs(2, short1.c_str()), false), runtime_error);
string short2(address1Hex+2, address1Hex+sizeof(address1Hex)); // first byte missing
string short2(address1Hex+1, address1Hex+sizeof(address1Hex)); // first byte missing
BOOST_CHECK_THROW(addmultisig(createArgs(2, short2.c_str()), false), runtime_error);
}
+2 -2
View File
@@ -994,7 +994,7 @@ void ShrinkDebugFile()
// "Never go to sea with two chronometers; take one or three."
// Our three time sources are:
// - System clock
// - Median of other nodes's clocks
// - Median of other nodes clocks
// - The user (asking the user to fix the system clock if the first two disagree)
//
static int64 nMockTime = 0; // For unit testing
@@ -1257,7 +1257,7 @@ bool SetStartOnSystemStartup(bool fAutoStart) { return false; }
// --> may result in deadlock between the two threads, depending on when they run.
// Solution implemented here:
// Keep track of pairs of locks: (A before B), (A before C), etc.
// Complain if any thread trys to lock in a different order.
// Complain if any thread tries to lock in a different order.
//
struct CLockLocation
+1 -1
View File
@@ -423,7 +423,7 @@ inline int64 GetPerformanceCounter()
#else
timeval t;
gettimeofday(&t, NULL);
nCounter = t.tv_sec * 1000000 + t.tv_usec;
nCounter = (int64) t.tv_sec * 1000000 + t.tv_usec;
#endif
return nCounter;
}
+1 -1
View File
@@ -67,7 +67,7 @@ private:
// the current wallet version: clients below this version are not able to load the wallet
int nWalletVersion;
// the maxmimum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded
// the maximum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded
int nWalletMaxVersion;
public: