aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/irc.cpp5
-rw-r--r--src/main.h18
-rw-r--r--src/net.cpp2
-rw-r--r--src/qt/bitcoingui.cpp58
-rw-r--r--src/qt/bitcoingui.h3
5 files changed, 68 insertions, 18 deletions
diff --git a/src/irc.cpp b/src/irc.cpp
index 17d5ff1a5a..e8471a6630 100644
--- a/src/irc.cpp
+++ b/src/irc.cpp
@@ -192,6 +192,8 @@ void ThreadIRCSeed(void* parg)
// Make this thread recognisable as the IRC seeding thread
RenameThread("bitcoin-ircseed");
+ printf("ThreadIRCSeed started\n");
+
try
{
ThreadIRCSeed2(parg);
@@ -218,7 +220,8 @@ void ThreadIRCSeed2(void* parg)
if (!GetBoolArg("-irc", false))
return;
- printf("ThreadIRCSeed started\n");
+ printf("ThreadIRCSeed trying to connect...\n");
+
int nErrorWait = 10;
int nRetryWait = 10;
int nNameRetry = 0;
diff --git a/src/main.h b/src/main.h
index 1751ccc562..744c0e4b51 100644
--- a/src/main.h
+++ b/src/main.h
@@ -24,21 +24,34 @@ class CNode;
class CBlockIndexWorkComparator;
+/** The maximum allowed size for a serialized block, in bytes (network rule) */
static const unsigned int MAX_BLOCK_SIZE = 1000000;
+/** The maximum size for mined blocks */
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2;
+/** The maximum allowed number of signature check operations in a block (network rule) */
static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;
+/** The maximum number of orphan transactions kept in memory */
static const unsigned int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100;
+/** The maximum number of entries in an 'inv' protocol message */
static const unsigned int MAX_INV_SZ = 50000;
+/** The maximum size of a blk?????.dat file (since 0.8) */
static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB
+/** The pre-allocation chunk size for blk?????.dat files (since 0.8) */
static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB
+/** The pre-allocation chunk size for rev?????.dat files (since 0.8) */
static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB
+/** Fake height value used in CCoins to signify they are only in the memory pool (since 0.8) */
static const unsigned int MEMPOOL_HEIGHT = 0x7FFFFFFF;
+/** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */
static const int64 MIN_TX_FEE = 50000;
+/** Fees smaller than this (in satoshi) are considered zero fee (for relaying) */
static const int64 MIN_RELAY_TX_FEE = 10000;
+/** No amount larger than this (in satoshi) is valid */
static const int64 MAX_MONEY = 21000000 * COIN;
inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
+/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
static const int COINBASE_MATURITY = 100;
-// Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp.
+/** Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp. */
static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC
#ifdef USE_UPNP
static const int fHaveUPnP = true;
@@ -1825,6 +1838,9 @@ public:
// Calculate statistics about the unspent transaction output set
virtual bool GetStats(CCoinsStats &stats);
+
+ // As we use CCoinsViews polymorphically, have a virtual destructor
+ virtual ~CCoinsView() {};
};
/** CCoinsView backed by another CCoinsView */
diff --git a/src/net.cpp b/src/net.cpp
index 272e6ff0b4..b54f8c15f7 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1309,6 +1309,8 @@ void DumpAddresses()
void ThreadDumpAddress2(void* parg)
{
+ printf("ThreadDumpAddress started\n");
+
vnThreadsRunning[THREAD_DUMPADDRESS]++;
while (!fShutdown)
{
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index ed0c845ed9..c09e1ce447 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -176,6 +176,9 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
// Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));
+ // Install event filter to be able to catch status tip events (QEvent::StatusTip)
+ this->installEventFilter(this);
+
gotoOverviewPage();
}
@@ -193,31 +196,36 @@ void BitcoinGUI::createActions()
QActionGroup *tabGroup = new QActionGroup(this);
overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this);
- overviewAction->setToolTip(tr("Show general overview of wallet"));
+ overviewAction->setStatusTip(tr("Show general overview of wallet"));
+ overviewAction->setToolTip(overviewAction->statusTip());
overviewAction->setCheckable(true);
overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1));
tabGroup->addAction(overviewAction);
sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this);
- sendCoinsAction->setToolTip(tr("Send coins to a Bitcoin address"));
+ sendCoinsAction->setStatusTip(tr("Send coins to a Bitcoin address"));
+ sendCoinsAction->setToolTip(sendCoinsAction->statusTip());
sendCoinsAction->setCheckable(true);
sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
tabGroup->addAction(sendCoinsAction);
receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this);
- receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments"));
+ receiveCoinsAction->setStatusTip(tr("Show the list of addresses for receiving payments"));
+ receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip());
receiveCoinsAction->setCheckable(true);
receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
tabGroup->addAction(receiveCoinsAction);
historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this);
- historyAction->setToolTip(tr("Browse transaction history"));
+ historyAction->setStatusTip(tr("Browse transaction history"));
+ historyAction->setToolTip(historyAction->statusTip());
historyAction->setCheckable(true);
historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
tabGroup->addAction(historyAction);
addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this);
- addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels"));
+ addressBookAction->setStatusTip(tr("Edit the list of stored addresses and labels"));
+ addressBookAction->setToolTip(addressBookAction->statusTip());
addressBookAction->setCheckable(true);
addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
tabGroup->addAction(addressBookAction);
@@ -234,33 +242,37 @@ void BitcoinGUI::createActions()
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage()));
quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this);
- quitAction->setToolTip(tr("Quit application"));
+ quitAction->setStatusTip(tr("Quit application"));
quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
quitAction->setMenuRole(QAction::QuitRole);
aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About Bitcoin"), this);
- aboutAction->setToolTip(tr("Show information about Bitcoin"));
+ aboutAction->setStatusTip(tr("Show information about Bitcoin"));
aboutAction->setMenuRole(QAction::AboutRole);
aboutQtAction = new QAction(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this);
- aboutQtAction->setToolTip(tr("Show information about Qt"));
+ aboutQtAction->setStatusTip(tr("Show information about Qt"));
aboutQtAction->setMenuRole(QAction::AboutQtRole);
optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this);
- optionsAction->setToolTip(tr("Modify configuration options for Bitcoin"));
+ optionsAction->setStatusTip(tr("Modify configuration options for Bitcoin"));
optionsAction->setMenuRole(QAction::PreferencesRole);
toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this);
+ toggleHideAction->setStatusTip(tr("Show or hide the main Window"));
encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this);
- encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet"));
+ encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet"));
encryptWalletAction->setCheckable(true);
backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this);
- backupWalletAction->setToolTip(tr("Backup wallet to another location"));
+ backupWalletAction->setStatusTip(tr("Backup wallet to another location"));
changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this);
- changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption"));
+ changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption"));
signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this);
+ signMessageAction->setStatusTip(tr("Sign messages with your Bitcoin addresses to prove you own them"));
verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this);
+ verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Bitcoin addresses"));
exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this);
- exportAction->setToolTip(tr("Export the data in the current tab to a file"));
+ exportAction->setStatusTip(tr("Export the data in the current tab to a file"));
+ exportAction->setToolTip(exportAction->statusTip());
openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this);
- openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console"));
+ openRPCConsoleAction->setStatusTip(tr("Open debugging and diagnostic console"));
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
@@ -338,7 +350,8 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel)
#endif
if(trayIcon)
{
- trayIcon->setToolTip(tr("Bitcoin client") + QString(" ") + tr("[testnet]"));
+ // Just attach " [testnet]" to the existing tooltip
+ trayIcon->setToolTip(trayIcon->toolTip() + QString(" ") + tr("[testnet]"));
trayIcon->setIcon(QIcon(":/icons/toolbar_testnet"));
toggleHideAction->setIcon(QIcon(":/icons/toolbar_testnet"));
}
@@ -472,6 +485,9 @@ void BitcoinGUI::setNumConnections(int count)
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
if (!clientModel || (clientModel->getNumConnections() == 0 && !clientModel->isImporting()))
{
@@ -750,6 +766,18 @@ void BitcoinGUI::dropEvent(QDropEvent *event)
event->acceptProposedAction();
}
+bool BitcoinGUI::eventFilter(QObject *object, QEvent *event)
+{
+ // Catch status tip events
+ if (event->type() == QEvent::StatusTip)
+ {
+ // Prevent adding text from setStatusTip(), if we currently use the status bar for displaying other stuff
+ if (progressBarLabel->isVisible() && progressBar->isVisible())
+ return true;
+ }
+ return QMainWindow::eventFilter(object, event);
+}
+
void BitcoinGUI::handleURI(QString strURI)
{
// URI has to be valid
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index c67e887c0f..a48911ee7f 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -52,6 +52,7 @@ protected:
void closeEvent(QCloseEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent *event);
+ bool eventFilter(QObject *object, QEvent *event);
private:
ClientModel *clientModel;
@@ -172,7 +173,7 @@ private slots:
/** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */
void showNormalIfMinimized(bool fToggleHidden = false);
- /** simply calls showNormalIfMinimized(true) for use in SLOT() macro */
+ /** Simply calls showNormalIfMinimized(true) for use in SLOT() macro */
void toggleHidden();
};