diff options
-rw-r--r-- | bitcoin-qt.pro | 6 | ||||
-rwxr-xr-x | contrib/verifysfbinaries/verify.sh | 2 | ||||
-rw-r--r-- | doc/Tor.txt | 4 | ||||
-rw-r--r-- | doc/assets-attribution.txt | 8 | ||||
-rw-r--r-- | doc/build-osx.md | 12 | ||||
-rw-r--r-- | src/main.cpp | 12 | ||||
-rw-r--r-- | src/makefile.unix | 6 | ||||
-rw-r--r-- | src/qt/bitcoin.cpp | 14 | ||||
-rw-r--r-- | src/qt/bitcoin.qrc | 3 | ||||
-rw-r--r-- | src/qt/bitcoingui.cpp | 38 | ||||
-rw-r--r-- | src/qt/clientmodel.cpp | 7 | ||||
-rw-r--r-- | src/qt/clientmodel.h | 4 | ||||
-rw-r--r-- | src/qt/res/bitcoin-qt.rc | 1 | ||||
-rwxr-xr-x | src/qt/res/icons/bitcoin_testnet.ico | bin | 0 -> 45855 bytes | |||
-rw-r--r-- | src/qt/res/icons/toolbar.png | bin | 1687 -> 1787 bytes | |||
-rw-r--r-- | src/qt/res/icons/toolbar_testnet.png | bin | 1727 -> 1748 bytes | |||
-rw-r--r-- | src/qt/res/images/splash.png | bin | 0 -> 49338 bytes | |||
-rw-r--r-- | src/qt/res/images/splash2.jpg | bin | 5816 -> 0 bytes | |||
-rw-r--r-- | src/qt/res/images/splash_testnet.png | bin | 0 -> 45370 bytes | |||
-rw-r--r-- | src/qt/splashscreen.cpp | 82 | ||||
-rw-r--r-- | src/qt/splashscreen.h | 16 |
21 files changed, 171 insertions, 44 deletions
diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index cf809866c6..d938c07c45 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -210,7 +210,8 @@ HEADERS += src/qt/bitcoingui.h \ src/txdb.h \ src/leveldb.h \ src/threadsafety.h \ - src/limitedmap.h + src/limitedmap.h \ + src/qt/splashscreen.h SOURCES += src/qt/bitcoin.cpp \ src/qt/bitcoingui.cpp \ @@ -277,7 +278,8 @@ SOURCES += src/qt/bitcoin.cpp \ src/qt/rpcconsole.cpp \ src/noui.cpp \ src/leveldb.cpp \ - src/txdb.cpp + src/txdb.cpp \ + src/qt/splashscreen.cpp RESOURCES += src/qt/bitcoin.qrc diff --git a/contrib/verifysfbinaries/verify.sh b/contrib/verifysfbinaries/verify.sh index 02814d894b..b109cd3ed0 100755 --- a/contrib/verifysfbinaries/verify.sh +++ b/contrib/verifysfbinaries/verify.sh @@ -18,7 +18,7 @@ WORKINGDIR="/tmp/bitcoin" TMPFILE="hashes.tmp" #this URL is used if a version number is not specified as an argument to the script -SIGNATUREFILE="http://downloads.sourceforge.net/project/bitcoin/Bitcoin/bitcoin-0.8.0/SHA256SUMS.asc" +SIGNATUREFILE="http://downloads.sourceforge.net/project/bitcoin/Bitcoin/bitcoin-0.8.1/SHA256SUMS.asc" SIGNATUREFILENAME="SHA256SUMS.asc" RCSUBDIR="test/" diff --git a/doc/Tor.txt b/doc/Tor.txt index f515f96f49..386e3b5466 100644 --- a/doc/Tor.txt +++ b/doc/Tor.txt @@ -3,7 +3,7 @@ TOR SUPPORT IN BITCOIN It is possible to run Bitcoin as a Tor hidden service, and connect to such services. -The following assumes you have a Tor proxy running on port 9050. Many distributions +The following directions assume you have a Tor proxy running on port 9050. Many distributions default to having a SOCKS proxy listening on port 9050, but others may not. In particular, the Tor Browser Bundle defaults to listening on a random port. See https://www.torproject.org/docs/faq.html.en#TBBSocksPort for how to properly @@ -77,7 +77,7 @@ In a typical situation, where you're only reachable via Tor, this should suffice ./bitcoind -proxy=127.0.0.1:9050 -externalip=57qr3yd1nyntf5k.onion -listen -(obviously replace the Onion address with your own). If you don't care too much +(obviously, replace the Onion address with your own). If you don't care too much about hiding your node, and want to be reachable on IPv4 as well, additionally specify: diff --git a/doc/assets-attribution.txt b/doc/assets-attribution.txt index efd5c65a29..2069c5d6e0 100644 --- a/doc/assets-attribution.txt +++ b/doc/assets-attribution.txt @@ -44,11 +44,6 @@ Designer: Everaldo (Everaldo Coelho) License: GNU/GPL Site: http://findicons.com/icon/17102/reload?id=17102 -Image: src/qt/res/images/splash2.jpg (Wallet image) -Designer: Crobbo (forum) -Site: https://bitcointalk.org/index.php?topic=32273.0 -License: Public domain - Icon: src/qt/res/icons/debugwindow.png Designer: Vignoni David Site: http://www.oxygen-icons.org/ @@ -57,6 +52,7 @@ License: Oxygen icon theme is dual licensed. You may copy it under the Creative Icon: src/qt/res/icons/bitcoin.icns, src/qt/res/src/bitcoin.svg, src/qt/res/src/bitcoin.ico, src/qt/res/src/bitcoin.png, src/qt/res/src/bitcoin_testnet.png, docs/bitcoin_logo_doxygen.png, - src/qt/res/icons/toolbar.png, src/qt/res/icons/toolbar_testnet.png + src/qt/res/icons/toolbar.png, src/qt/res/icons/toolbar_testnet.png, + src/qt/res/images/splash.png, src/qt/res/images/splash_testnet.png Designer: Jonas Schnelli (based on the original bitcoin logo from Bitboy) License: MIT diff --git a/doc/build-osx.md b/doc/build-osx.md index 1ed593d5eb..d9aa779f87 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -95,6 +95,18 @@ Instructions: HomeBrew brew install boost miniupnpc openssl berkeley-db4 +Note: After you have installed the dependencies, you should check that the Brew installed version of OpenSSL is the one available for compilation. You can check this by typing + + openssl version + +into Terminal. You should see OpenSSL 1.0.1e 11 Feb 2013. + +If not, you can ensure that the Brew OpenSSL is correctly linked by running + + brew link openssl --force + +Rerunning "openssl version" should now return the correct version. + ### Building `bitcoind` 1. Clone the github tree to get the source code and go into the directory. diff --git a/src/main.cpp b/src/main.cpp index bf13e79151..aace382d8b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -768,7 +768,7 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fCheckIn // Check against previous transactions // This is done last to help prevent CPU exhaustion denial-of-service attacks. - if (!tx.CheckInputs(state, view, true, SCRIPT_VERIFY_P2SH)) + if (!tx.CheckInputs(state, view, true, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC)) { return error("CTxMemPool::accept() : ConnectInputs failed %s", hash.ToString().c_str()); } @@ -1438,8 +1438,16 @@ bool CTransaction::CheckInputs(CValidationState &state, CCoinsViewCache &inputs, if (pvChecks) { pvChecks->push_back(CScriptCheck()); check.swap(pvChecks->back()); - } else if (!check()) + } else if (!check()) { + if (flags & SCRIPT_VERIFY_STRICTENC) { + // For now, check whether the failure was caused by non-canonical + // encodings or not; if so, don't trigger DoS protection. + CScriptCheck check(coins, *this, i, flags & (~SCRIPT_VERIFY_STRICTENC), 0); + if (check()) + return state.Invalid(); + } return state.DoS(100,false); + } } } } diff --git a/src/makefile.unix b/src/makefile.unix index 081edaf63e..8110235647 100644 --- a/src/makefile.unix +++ b/src/makefile.unix @@ -2,7 +2,13 @@ # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. +# :=0 --> UPnP support turned off by default at runtime +# :=1 --> UPnP support turned on by default at runtime +# :=- --> No UPnP support - miniupnp not required USE_UPNP:=0 + +# :=1 --> Enable IPv6 support +# :=0 --> Disable IPv6 support USE_IPV6:=1 LINK:=$(CXX) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 9f0f6209f9..25448ea8cf 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -14,13 +14,13 @@ #include "util.h" #include "ui_interface.h" #include "paymentserver.h" +#include "splashscreen.h" #include <QMessageBox> #include <QTextCodec> #include <QLocale> #include <QTimer> #include <QTranslator> -#include <QSplashScreen> #include <QLibraryInfo> #if defined(BITCOIN_NEED_QT_PLUGINS) && !defined(_BITCOIN_QT_PLUGINS_INCLUDED) @@ -34,9 +34,12 @@ Q_IMPORT_PLUGIN(qkrcodecs) Q_IMPORT_PLUGIN(qtaccessiblewidgets) #endif +// Declare meta types used for QMetaObject::invokeMethod +Q_DECLARE_METATYPE(bool*) + // Need a global reference for the notifications to find the GUI static BitcoinGUI *guiref; -static QSplashScreen *splashref; +static SplashScreen *splashref; static bool ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style) { @@ -82,7 +85,7 @@ static void InitMessage(const std::string &message) { if(splashref) { - splashref->showMessage(QString::fromStdString(message), Qt::AlignBottom|Qt::AlignHCenter, QColor(255,255,200)); + splashref->showMessage(QString::fromStdString(message), Qt::AlignBottom|Qt::AlignHCenter, QColor(55,55,55)); qApp->processEvents(); } printf("init message: %s\n", message.c_str()); @@ -118,6 +121,9 @@ int main(int argc, char *argv[]) Q_INIT_RESOURCE(bitcoin); QApplication app(argc, argv); + // Register meta types used for QMetaObject::invokeMethod + qRegisterMetaType< bool* >(); + // Do this early as we don't want to bother initializing if we are just calling IPC // ... but do it after creating app, so QCoreApplication::arguments is initialized: if (PaymentServer::ipcSendCommandLine()) @@ -192,7 +198,7 @@ int main(int argc, char *argv[]) return 1; } - QSplashScreen splash(QPixmap(":/images/splash"), 0); + SplashScreen splash(QPixmap(), 0); if (GetBoolArg("-splash", true) && !GetBoolArg("-min")) { splash.show(); diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index fd5f3b523c..c0e0124d7c 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -43,7 +43,8 @@ </qresource> <qresource prefix="/images"> <file alias="about">res/images/about.png</file> - <file alias="splash">res/images/splash2.jpg</file> + <file alias="splash">res/images/splash.png</file> + <file alias="splash_testnet">res/images/splash_testnet.png</file> </qresource> <qresource prefix="/movies"> <file alias="update_spinner">res/movies/update_spinner.mng</file> diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 50a4f63db0..71db587e04 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -504,31 +504,26 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) // Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text) statusBar()->clearMessage(); - // don't show / hide progress bar and its label if we have no connection to the network - enum BlockSource blockSource = clientModel ? clientModel->getBlockSource() : BLOCK_SOURCE_NONE; - if (blockSource == BLOCK_SOURCE_NONE || (blockSource == BLOCK_SOURCE_NETWORK && clientModel->getNumConnections() == 0)) - { - progressBarLabel->setVisible(false); - progressBar->setVisible(false); - - return; + // Acquire current block source + enum BlockSource blockSource = clientModel->getBlockSource(); + switch (blockSource) { + case BLOCK_SOURCE_NETWORK: + progressBarLabel->setText(tr("Synchronizing with network...")); + break; + case BLOCK_SOURCE_DISK: + progressBarLabel->setText(tr("Importing blocks from disk...")); + break; + case BLOCK_SOURCE_REINDEX: + progressBarLabel->setText(tr("Reindexing blocks on disk...")); + break; + case BLOCK_SOURCE_NONE: + // Case: not Importing, not Reindexing and no network connection + progressBarLabel->setText(tr("No block source available...")); + break; } QString tooltip; - QString importText; - switch (blockSource) { - case BLOCK_SOURCE_NONE: - case BLOCK_SOURCE_NETWORK: - importText = tr("Synchronizing with network..."); - break; - case BLOCK_SOURCE_DISK: - importText = tr("Importing blocks from disk..."); - break; - case BLOCK_SOURCE_REINDEX: - importText = tr("Reindexing blocks on disk..."); - } - QDateTime lastBlockDate = clientModel->getLastBlockDate(); QDateTime currentDate = QDateTime::currentDateTime(); int secs = lastBlockDate.secsTo(currentDate); @@ -570,7 +565,6 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) timeBehindText = tr("%n week(s)","",secs/(7*24*60*60)); } - progressBarLabel->setText(importText); progressBarLabel->setVisible(true); progressBar->setFormat(tr("%1 behind").arg(timeBehindText)); progressBar->setMaximum(1000000000); diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index c17c602b50..e8d99a8d45 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -122,9 +122,12 @@ enum BlockSource ClientModel::getBlockSource() const { if (fReindex) return BLOCK_SOURCE_REINDEX; - if (fImporting) + else if (fImporting) return BLOCK_SOURCE_DISK; - return BLOCK_SOURCE_NETWORK; + else if (getNumConnections() > 0) + return BLOCK_SOURCE_NETWORK; + + return BLOCK_SOURCE_NONE; } int ClientModel::getNumBlocksOfPeers() const diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index 904bff1886..f9d491aa50 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -15,9 +15,9 @@ QT_END_NAMESPACE enum BlockSource { BLOCK_SOURCE_NONE, - BLOCK_SOURCE_NETWORK, + BLOCK_SOURCE_REINDEX, BLOCK_SOURCE_DISK, - BLOCK_SOURCE_REINDEX + BLOCK_SOURCE_NETWORK }; /** Model for Bitcoin network client. */ diff --git a/src/qt/res/bitcoin-qt.rc b/src/qt/res/bitcoin-qt.rc index eeac772dc9..3e3672a835 100644 --- a/src/qt/res/bitcoin-qt.rc +++ b/src/qt/res/bitcoin-qt.rc @@ -1,4 +1,5 @@ IDI_ICON1 ICON DISCARDABLE "icons/bitcoin.ico" +IDI_ICON2 ICON DISCARDABLE "icons/bitcoin_testnet.ico" #include <windows.h> // needed for VERSIONINFO #include "../../clientversion.h" // holds the needed client version information diff --git a/src/qt/res/icons/bitcoin_testnet.ico b/src/qt/res/icons/bitcoin_testnet.ico Binary files differnew file mode 100755 index 0000000000..d67d9d5ce5 --- /dev/null +++ b/src/qt/res/icons/bitcoin_testnet.ico diff --git a/src/qt/res/icons/toolbar.png b/src/qt/res/icons/toolbar.png Binary files differindex 44c7d88bca..b694302871 100644 --- a/src/qt/res/icons/toolbar.png +++ b/src/qt/res/icons/toolbar.png diff --git a/src/qt/res/icons/toolbar_testnet.png b/src/qt/res/icons/toolbar_testnet.png Binary files differindex 9b5d82c787..dcac261c36 100644 --- a/src/qt/res/icons/toolbar_testnet.png +++ b/src/qt/res/icons/toolbar_testnet.png diff --git a/src/qt/res/images/splash.png b/src/qt/res/images/splash.png Binary files differnew file mode 100644 index 0000000000..376c274a8d --- /dev/null +++ b/src/qt/res/images/splash.png diff --git a/src/qt/res/images/splash2.jpg b/src/qt/res/images/splash2.jpg Binary files differdeleted file mode 100644 index 3846e6f68d..0000000000 --- a/src/qt/res/images/splash2.jpg +++ /dev/null diff --git a/src/qt/res/images/splash_testnet.png b/src/qt/res/images/splash_testnet.png Binary files differnew file mode 100644 index 0000000000..2520e76e62 --- /dev/null +++ b/src/qt/res/images/splash_testnet.png diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp new file mode 100644 index 0000000000..f8d16699ca --- /dev/null +++ b/src/qt/splashscreen.cpp @@ -0,0 +1,82 @@ +#include "splashscreen.h" +#include "clientversion.h" +#include "util.h" + +#include <QPainter> +#include <QApplication> + +SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f) : + QSplashScreen(pixmap, f) +{ + // set reference point, paddings + int paddingRight = 50; + int paddingTop = 50; + int titleVersionVSpace = 17; + int titleCopyrightVSpace = 40; + + float fontFactor = 1.0; + + // define text to place + QString titleText = QString(QApplication::applicationName()).replace(QString("-testnet"), QString(""), Qt::CaseSensitive); // cut of testnet, place it as single object further down + QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion())); + QString copyrightText = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin developers")); + QString testnetAddText = QString(tr("[testnet]")); // define text to place as single text object + + QString font = "Arial"; + + // load the bitmap for writing some text over it + QPixmap newPixmap; + if(GetBoolArg("-testnet")) { + newPixmap = QPixmap(":/images/splash_testnet"); + } + else { + newPixmap = QPixmap(":/images/splash"); + } + + QPainter pixPaint(&newPixmap); + pixPaint.setPen(QColor(100,100,100)); + + // check font size and drawing with + pixPaint.setFont(QFont(font, 33*fontFactor)); + QFontMetrics fm = pixPaint.fontMetrics(); + int titleTextWidth = fm.width(titleText); + if(titleTextWidth > 160) { + // strange font rendering, Arial probably not found + fontFactor = 0.75; + } + + pixPaint.setFont(QFont(font, 33*fontFactor)); + fm = pixPaint.fontMetrics(); + titleTextWidth = fm.width(titleText); + pixPaint.drawText(newPixmap.width()-titleTextWidth-paddingRight,paddingTop,titleText); + + pixPaint.setFont(QFont(font, 15*fontFactor)); + + // if the version string is to long, reduce size + fm = pixPaint.fontMetrics(); + int versionTextWidth = fm.width(versionText); + if(versionTextWidth > titleTextWidth+paddingRight-10) { + pixPaint.setFont(QFont(font, 10*fontFactor)); + titleVersionVSpace -= 5; + } + pixPaint.drawText(newPixmap.width()-titleTextWidth-paddingRight+2,paddingTop+titleVersionVSpace,versionText); + + // draw copyright stuff + pixPaint.setFont(QFont(font, 10*fontFactor)); + pixPaint.drawText(newPixmap.width()-titleTextWidth-paddingRight,paddingTop+titleCopyrightVSpace,copyrightText); + + // draw testnet string if -testnet is on + if(QApplication::applicationName().contains(QString("-testnet"))) { + // draw copyright stuff + QFont boldFont = QFont(font, 10*fontFactor); + boldFont.setWeight(QFont::Bold); + pixPaint.setFont(boldFont); + fm = pixPaint.fontMetrics(); + int testnetAddTextWidth = fm.width(testnetAddText); + pixPaint.drawText(newPixmap.width()-testnetAddTextWidth-10,15,testnetAddText); + } + + pixPaint.end(); + + this->setPixmap(newPixmap); +} diff --git a/src/qt/splashscreen.h b/src/qt/splashscreen.h new file mode 100644 index 0000000000..6a6249d80c --- /dev/null +++ b/src/qt/splashscreen.h @@ -0,0 +1,16 @@ +#ifndef SPLASHSCREEN_H +#define SPLASHSCREEN_H + +#include <QSplashScreen> + +/** class for the splashscreen with information of the running client + */ +class SplashScreen : public QSplashScreen +{ + Q_OBJECT + +public: + explicit SplashScreen(const QPixmap &pixmap = QPixmap(), Qt::WindowFlags f = 0); +}; + +#endif // SPLASHSCREEN_H |