aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--src/bitcoind.cpp2
-rw-r--r--src/checkpoints.cpp17
-rw-r--r--src/compat.h6
-rw-r--r--src/init.cpp2
-rw-r--r--src/main.cpp12
-rw-r--r--src/qt/bitcoingui.cpp28
-rw-r--r--src/qt/bitcoingui.h4
-rw-r--r--src/qt/bitcoinstrings.cpp2
-rw-r--r--src/qt/guiutil.cpp25
-rw-r--r--src/qt/guiutil.h5
-rw-r--r--src/qt/intro.cpp4
-rw-r--r--src/qt/locale/bitcoin_en.ts95
-rw-r--r--src/qt/rpcconsole.cpp2
-rw-r--r--src/test/data/script_invalid.json16
-rw-r--r--src/test/data/script_valid.json15
-rw-r--r--src/util.cpp2
-rw-r--r--src/util.h2
18 files changed, 153 insertions, 88 deletions
diff --git a/README.md b/README.md
index bd5dd6ddd9..5453f998dc 100644
--- a/README.md
+++ b/README.md
@@ -38,7 +38,7 @@ submitter will be asked to start a discussion (if they haven't already) on the
The patch will be accepted if there is broad consensus that it is a good thing.
Developers should expect to rework and resubmit patches if the code doesn't
-match the project's coding conventions (see `doc/coding.txt`) or are
+match the project's coding conventions (see `doc/coding.md`) or are
controversial.
The `master` branch is regularly built and tested, but is not guaranteed to be
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp
index bc23cf5507..be18f9ae83 100644
--- a/src/bitcoind.cpp
+++ b/src/bitcoind.cpp
@@ -74,7 +74,7 @@ bool AppInit(int argc, char* argv[])
int ret = CommandLineRPC(argc, argv);
exit(ret);
}
-#if !defined(WIN32)
+#ifndef WIN32
fDaemon = GetBoolArg("-daemon", false);
if (fDaemon)
{
diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp
index ba29e2463e..0716cfca31 100644
--- a/src/checkpoints.cpp
+++ b/src/checkpoints.cpp
@@ -67,11 +67,24 @@ namespace Checkpoints
300
};
+ static MapCheckpoints mapCheckpointsRegtest =
+ boost::assign::map_list_of
+ ( 0, uint256("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"))
+ ;
+ static const CCheckpointData dataRegtest = {
+ &mapCheckpointsRegtest,
+ 0,
+ 0,
+ 0
+ };
+
const CCheckpointData &Checkpoints() {
- if (TestNet())
+ if (Params().NetworkID() == CChainParams::TESTNET)
return dataTestnet;
- else
+ else if (Params().NetworkID() == CChainParams::MAIN)
return data;
+ else
+ return dataRegtest;
}
bool CheckBlock(int nHeight, const uint256& hash)
diff --git a/src/compat.h b/src/compat.h
index 706221692b..4e98b46c1c 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -3,7 +3,7 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef _BITCOIN_COMPAT_H
-#define _BITCOIN_COMPAT_H 1
+#define _BITCOIN_COMPAT_H
#ifdef WIN32
#define _WIN32_WINNT 0x0501
@@ -13,7 +13,6 @@
#endif
#define FD_SETSIZE 1024 // max number of fds in fd_set
#include <winsock2.h>
-#include <mswsock.h>
#include <ws2tcpip.h>
#else
#include <sys/types.h>
@@ -26,12 +25,11 @@
#include <ifaddrs.h>
#endif
-typedef u_int SOCKET;
#ifdef WIN32
#define MSG_NOSIGNAL 0
#define MSG_DONTWAIT 0
-typedef int socklen_t;
#else
+typedef u_int SOCKET;
#include "errno.h"
#define WSAGetLastError() errno
#define WSAEINVAL EINVAL
diff --git a/src/init.cpp b/src/init.cpp
index 49d6e1fde4..20d334019d 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -504,7 +504,7 @@ bool AppInit2(boost::thread_group& threadGroup)
// Wallet file must be a plain filename without a directory
if (strWalletFile != boost::filesystem::basename(strWalletFile) + boost::filesystem::extension(strWalletFile))
- return InitError(strprintf(_("Wallet %s resides outside data directory %s\n"), strWalletFile.c_str(), strDataDir.c_str()));
+ return InitError(strprintf(_("Wallet %s resides outside data directory %s"), strWalletFile.c_str(), strDataDir.c_str()));
// Make sure only a single Bitcoin process is using the data directory.
boost::filesystem::path pathLockFile = GetDataDir() / ".lock";
diff --git a/src/main.cpp b/src/main.cpp
index d006d83bf5..9de895374e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -803,9 +803,9 @@ bool CTxMemPool::accept(CValidationState &state, const CTransaction &tx, bool fL
if ((int64)tx.nLockTime > std::numeric_limits<int>::max())
return error("CTxMemPool::accept() : not accepting nLockTime beyond 2038 yet");
- // Rather not work on nonstandard transactions (unless -testnet)
+ // Rather not work on nonstandard transactions (unless -testnet/-regtest)
string reason;
- if (!TestNet() && !IsStandardTx(tx, reason))
+ if (Params().NetworkID() == CChainParams::MAIN && !IsStandardTx(tx, reason))
return error("CTxMemPool::accept() : nonstandard transaction: %s",
reason.c_str());
@@ -881,7 +881,7 @@ bool CTxMemPool::accept(CValidationState &state, const CTransaction &tx, bool fL
}
// Check for non-standard pay-to-script-hash in inputs
- if (!TestNet() && !AreInputsStandard(tx, view))
+ if (Params().NetworkID() == CChainParams::MAIN && !AreInputsStandard(tx, view))
return error("CTxMemPool::accept() : nonstandard transaction input");
// Note: if you modify this code to accept non-standard transactions, then
@@ -1931,7 +1931,7 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
}
// Disconnect shorter branch
- vector<CTransaction> vResurrect;
+ list<CTransaction> vResurrect;
BOOST_FOREACH(CBlockIndex* pindex, vDisconnect) {
CBlock block;
if (!ReadBlockFromDisk(block, pindex))
@@ -1945,9 +1945,9 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
// Queue memory transactions to resurrect.
// We only do this for blocks after the last checkpoint (reorganisation before that
// point should only happen with -reindex/-loadblock, or a misbehaving peer.
- BOOST_FOREACH(const CTransaction& tx, block.vtx)
+ BOOST_REVERSE_FOREACH(const CTransaction& tx, block.vtx)
if (!tx.IsCoinBase() && pindex->nHeight > Checkpoints::GetTotalBlocksEstimate())
- vResurrect.push_back(tx);
+ vResurrect.push_front(tx);
}
// Connect longer branch
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 4ed734b9c9..8ec2f03fad 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -48,8 +48,6 @@
#endif
#include <QMimeData>
#include <QStyle>
-#include <QSettings>
-#include <QDesktopWidget>
#include <QListWidget>
#include <iostream>
@@ -67,7 +65,7 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) :
rpcConsole(0),
prevBlocks(0)
{
- restoreWindowGeometry();
+ GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this);
#ifndef Q_OS_MAC
if (!fIsTestnet)
@@ -165,7 +163,7 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) :
BitcoinGUI::~BitcoinGUI()
{
- saveWindowGeometry();
+ GUIUtil::saveWindowGeometry("nWindow", this);
if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu)
trayIcon->hide();
#ifdef Q_OS_MAC
@@ -424,28 +422,6 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
}
#endif
-void BitcoinGUI::saveWindowGeometry()
-{
- QSettings settings;
- settings.setValue("nWindowPos", pos());
- settings.setValue("nWindowSize", size());
-}
-
-void BitcoinGUI::restoreWindowGeometry()
-{
- QSettings settings;
- QPoint pos = settings.value("nWindowPos").toPoint();
- QSize size = settings.value("nWindowSize", QSize(850, 550)).toSize();
- if (!pos.x() && !pos.y())
- {
- QRect screen = QApplication::desktop()->screenGeometry();
- pos.setX((screen.width()-size.width())/2);
- pos.setY((screen.height()-size.height())/2);
- }
- resize(size);
- move(pos);
-}
-
void BitcoinGUI::optionsClicked()
{
if(!clientModel || !clientModel->getOptionsModel())
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index 685ce8b430..6b9161539c 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -122,10 +122,6 @@ private:
void createTrayIcon(bool fIsTestnet);
/** Create system tray menu (or setup the dock menu) */
void createTrayIconMenu();
- /** Save window size and position */
- void saveWindowGeometry();
- /** Restore window size and position */
- void restoreWindowGeometry();
public slots:
/** Set number of connections shown in the UI */
diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp
index cb09e93e76..fc0e53887a 100644
--- a/src/qt/bitcoinstrings.cpp
+++ b/src/qt/bitcoinstrings.cpp
@@ -186,6 +186,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Specify configuration file (default: bitcoin.
QT_TRANSLATE_NOOP("bitcoin-core", "Specify connection timeout in milliseconds (default: 5000)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify data directory"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify pid file (default: bitcoind.pid)"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Specify wallet file (within data directory)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"),
QT_TRANSLATE_NOOP("bitcoin-core", "System error: "),
QT_TRANSLATE_NOOP("bitcoin-core", "This help message"),
@@ -207,6 +208,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Use the test network"),
QT_TRANSLATE_NOOP("bitcoin-core", "Username for JSON-RPC connections"),
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying blocks..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet..."),
+QT_TRANSLATE_NOOP("bitcoin-core", "Wallet %s resides outside data directory %s"),
QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart Bitcoin to complete"),
QT_TRANSLATE_NOOP("bitcoin-core", "Warning"),
QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade required!"),
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 0ea5060e76..32131bc39d 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -23,6 +23,8 @@
#include <QFileDialog>
#include <QDesktopServices>
#include <QThread>
+#include <QSettings>
+#include <QDesktopWidget>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
@@ -486,6 +488,29 @@ bool SetStartOnSystemStartup(bool fAutoStart) { return false; }
#endif
+void saveWindowGeometry(const QString& strSetting, QWidget *parent)
+{
+ QSettings settings;
+ settings.setValue(strSetting + "Pos", parent->pos());
+ settings.setValue(strSetting + "Size", parent->size());
+}
+
+void restoreWindowGeometry(const QString& strSetting, const QSize& defaultSize, QWidget *parent)
+{
+ QSettings settings;
+ QPoint pos = settings.value(strSetting + "Pos").toPoint();
+ QSize size = settings.value(strSetting + "Size", defaultSize).toSize();
+
+ if (!pos.x() && !pos.y()) {
+ QRect screen = QApplication::desktop()->screenGeometry();
+ pos.setX((screen.width() - size.width()) / 2);
+ pos.setY((screen.height() - size.height()) / 2);
+ }
+
+ parent->resize(size);
+ parent->move(pos);
+}
+
HelpMessageBox::HelpMessageBox(QWidget *parent) :
QMessageBox(parent)
{
diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h
index e2c7d18aa2..ca3e7fe91d 100644
--- a/src/qt/guiutil.h
+++ b/src/qt/guiutil.h
@@ -96,6 +96,11 @@ namespace GUIUtil
bool GetStartOnSystemStartup();
bool SetStartOnSystemStartup(bool fAutoStart);
+ /** Save window size and position */
+ void saveWindowGeometry(const QString& strSetting, QWidget *parent);
+ /** Restore window size and position */
+ void restoreWindowGeometry(const QString& strSetting, const QSize &defaultSizeIn, QWidget *parent);
+
/** Help message for Bitcoin-Qt, shown with --help. */
class HelpMessageBox : public QMessageBox
{
diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp
index 944899d3e8..99db141c94 100644
--- a/src/qt/intro.cpp
+++ b/src/qt/intro.cpp
@@ -80,9 +80,9 @@ void FreespaceChecker::check()
{
if(fs::is_directory(dataDir))
{
- QString separator = QDir::toNativeSeparators("/");
+ QString separator = "<code>" + QDir::toNativeSeparators("/") + tr("name") + "</code>";
replyStatus = ST_OK;
- replyMessage = tr("Directory already exists. Add <code>%1name</code> if you intend to create a new directory here.").arg(separator);
+ replyMessage = tr("Directory already exists. Add %1 if you intend to create a new directory here.").arg(separator);
} else {
replyStatus = ST_ERROR;
replyMessage = tr("Path already exists, and is not a directory.");
diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts
index 61af88d056..5ae067d9b8 100644
--- a/src/qt/locale/bitcoin_en.ts
+++ b/src/qt/locale/bitcoin_en.ts
@@ -324,17 +324,17 @@ This product includes software developed by the OpenSSL Project for use in the O
<context>
<name>BitcoinGUI</name>
<message>
- <location filename="../bitcoingui.cpp" line="+257"/>
+ <location filename="../bitcoingui.cpp" line="+254"/>
<source>Sign &amp;message...</source>
<translation>Sign &amp;message...</translation>
</message>
<message>
- <location line="+268"/>
+ <location line="+246"/>
<source>Synchronizing with network...</source>
<translation>Synchronizing with network...</translation>
</message>
<message>
- <location line="-343"/>
+ <location line="-321"/>
<source>&amp;Overview</source>
<translation>&amp;Overview</translation>
</message>
@@ -409,7 +409,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>&amp;Change Passphrase...</translation>
</message>
<message>
- <location line="+273"/>
+ <location line="+251"/>
<source>Importing blocks from disk...</source>
<translation>Importing blocks from disk...</translation>
</message>
@@ -419,7 +419,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>Reindexing blocks on disk...</translation>
</message>
<message>
- <location line="-341"/>
+ <location line="-319"/>
<source>Send coins to a Bitcoin address</source>
<translation>Send coins to a Bitcoin address</translation>
</message>
@@ -456,12 +456,12 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location line="-183"/>
<location line="+6"/>
- <location line="+530"/>
+ <location line="+508"/>
<source>Bitcoin</source>
<translation>Bitcoin</translation>
</message>
<message>
- <location line="-536"/>
+ <location line="-514"/>
<location line="+6"/>
<source>Wallet</source>
<translation>Wallet</translation>
@@ -546,7 +546,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>Bitcoin client</translation>
</message>
<message numerus="yes">
- <location line="+143"/>
+ <location line="+121"/>
<source>%n active connection(s) to Bitcoin network</source>
<translation>
<numerusform>%n active connection to Bitcoin network</numerusform>
@@ -688,7 +688,7 @@ Address: %4
<translation>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</translation>
</message>
<message>
- <location filename="../bitcoin.cpp" line="+111"/>
+ <location filename="../bitcoin.cpp" line="+110"/>
<source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>
<translation>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</translation>
</message>
@@ -772,14 +772,19 @@ Address: %4
<context>
<name>FreespaceChecker</name>
<message>
- <location filename="../intro.cpp" line="+60"/>
+ <location filename="../intro.cpp" line="+61"/>
<source>A new data directory will be created.</source>
<translation>A new data directory will be created.</translation>
</message>
<message>
- <location line="+17"/>
- <source>Directory already exists. Add &lt;code&gt;%1name&lt;/code&gt; if you intend to create a new directory here.</source>
- <translation>Directory already exists. Add &lt;code&gt;%1name&lt;/code&gt; if you intend to create a new directory here.</translation>
+ <location line="+22"/>
+ <source>name</source>
+ <translation>name</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>
+ <translation>Directory already exists. Add %1 if you intend to create a new directory here.</translation>
</message>
<message>
<location line="+3"/>
@@ -795,7 +800,7 @@ Address: %4
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
- <location filename="../guiutil.cpp" line="+493"/>
+ <location filename="../guiutil.cpp" line="+517"/>
<location line="+13"/>
<source>Bitcoin-Qt</source>
<translation>Bitcoin-Qt</translation>
@@ -1172,7 +1177,7 @@ Address: %4
<context>
<name>PaymentServer</name>
<message>
- <location filename="../paymentserver.cpp" line="+109"/>
+ <location filename="../paymentserver.cpp" line="+108"/>
<source>Cannot start bitcoin: click-to-pay handler</source>
<translation>Cannot start bitcoin: click-to-pay handler</translation>
</message>
@@ -1271,7 +1276,7 @@ Address: %4
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
- <location filename="../rpcconsole.cpp" line="+343"/>
+ <location filename="../rpcconsole.cpp" line="+345"/>
<source>N/A</source>
<translation>N/A</translation>
</message>
@@ -1772,7 +1777,7 @@ Address: %4
<context>
<name>SplashScreen</name>
<message>
- <location filename="../splashscreen.cpp" line="+23"/>
+ <location filename="../splashscreen.cpp" line="+22"/>
<source>The Bitcoin developers</source>
<translation>The Bitcoin developers</translation>
</message>
@@ -2330,12 +2335,12 @@ Address: %4
<translation>Bitcoin version</translation>
</message>
<message>
- <location line="+103"/>
+ <location line="+104"/>
<source>Usage:</source>
<translation>Usage:</translation>
</message>
<message>
- <location line="-29"/>
+ <location line="-30"/>
<source>Send command to -server or bitcoind</source>
<translation>Send command to -server or bitcoind</translation>
</message>
@@ -2390,7 +2395,7 @@ Address: %4
<translation>Connect to a node to retrieve peer addresses, and disconnect</translation>
</message>
<message>
- <location line="+83"/>
+ <location line="+84"/>
<source>Specify your own public address</source>
<translation>Specify your own public address</translation>
</message>
@@ -2400,7 +2405,7 @@ Address: %4
<translation>Threshold for disconnecting misbehaving peers (default: 100)</translation>
</message>
<message>
- <location line="-135"/>
+ <location line="-136"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</translation>
</message>
@@ -2425,12 +2430,12 @@ Address: %4
<translation>Run in the background as a daemon and accept commands</translation>
</message>
<message>
- <location line="+37"/>
+ <location line="+38"/>
<source>Use the test network</source>
<translation>Use the test network</translation>
</message>
<message>
- <location line="-113"/>
+ <location line="-114"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Accept connections from outside (default: 1 if no -proxy or -connect)</translation>
</message>
@@ -2695,7 +2700,12 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Set the number of threads to service RPC calls (default: 4)</translation>
</message>
<message>
- <location line="+26"/>
+ <location line="+7"/>
+ <source>Specify wallet file (within data directory)</source>
+ <translation>Specify wallet file (within data directory)</translation>
+ </message>
+ <message>
+ <location line="+20"/>
<source>Verifying blocks...</source>
<translation>Verifying blocks...</translation>
</message>
@@ -2705,12 +2715,17 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Verifying wallet...</translation>
</message>
<message>
+ <location line="+1"/>
+ <source>Wallet %s resides outside data directory %s</source>
+ <translation>Wallet %s resides outside data directory %s</translation>
+ </message>
+ <message>
<location line="+4"/>
<source>You need to rebuild the database using -reindex to change -txindex</source>
<translation>You need to rebuild the database using -reindex to change -txindex</translation>
</message>
<message>
- <location line="-74"/>
+ <location line="-76"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation>Imports blocks from external blk000??.dat file</translation>
</message>
@@ -2825,7 +2840,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Specify connection timeout in milliseconds (default: 5000)</translation>
</message>
<message>
- <location line="+4"/>
+ <location line="+5"/>
<source>System error: </source>
<translation>System error: </translation>
</message>
@@ -2865,7 +2880,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Username for JSON-RPC connections</translation>
</message>
<message>
- <location line="+4"/>
+ <location line="+5"/>
<source>Warning</source>
<translation>Warning</translation>
</message>
@@ -2880,7 +2895,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>wallet.dat corrupt, salvage failed</translation>
</message>
<message>
- <location line="-50"/>
+ <location line="-52"/>
<source>Password for JSON-RPC connections</source>
<translation>Password for JSON-RPC connections</translation>
</message>
@@ -2900,12 +2915,12 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Execute command when the best block changes (%s in cmd is replaced by block hash)</translation>
</message>
<message>
- <location line="+148"/>
+ <location line="+149"/>
<source>Upgrade wallet to latest format</source>
<translation>Upgrade wallet to latest format</translation>
</message>
<message>
- <location line="-21"/>
+ <location line="-22"/>
<source>Set key pool size to &lt;n&gt; (default: 100)</source>
<translation>Set key pool size to &lt;n&gt; (default: 100)</translation>
</message>
@@ -2915,12 +2930,12 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Rescan the block chain for missing wallet transactions</translation>
</message>
<message>
- <location line="+35"/>
+ <location line="+36"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Use OpenSSL (https) for JSON-RPC connections</translation>
</message>
<message>
- <location line="-26"/>
+ <location line="-27"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Server certificate file (default: server.cert)</translation>
</message>
@@ -2935,7 +2950,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
- <location line="+170"/>
+ <location line="+171"/>
<source>This help message</source>
<translation>This help message</translation>
</message>
@@ -2945,7 +2960,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Unable to bind to %s on this computer (bind returned error %d, %s)</translation>
</message>
<message>
- <location line="-92"/>
+ <location line="-93"/>
<source>Connect through socks proxy</source>
<translation>Connect through socks proxy</translation>
</message>
@@ -2970,12 +2985,12 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Error loading wallet.dat: Wallet requires newer version of Bitcoin</translation>
</message>
<message>
- <location line="+94"/>
+ <location line="+96"/>
<source>Wallet needed to be rewritten: restart Bitcoin to complete</source>
<translation>Wallet needed to be rewritten: restart Bitcoin to complete</translation>
</message>
<message>
- <location line="-96"/>
+ <location line="-98"/>
<source>Error loading wallet.dat</source>
<translation>Error loading wallet.dat</translation>
</message>
@@ -2985,7 +3000,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Invalid -proxy address: &apos;%s&apos;</translation>
</message>
<message>
- <location line="+56"/>
+ <location line="+57"/>
<source>Unknown network specified in -onlynet: &apos;%s&apos;</source>
<translation>Unknown network specified in -onlynet: &apos;%s&apos;</translation>
</message>
@@ -2995,7 +3010,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Unknown -socks proxy version requested: %i</translation>
</message>
<message>
- <location line="-97"/>
+ <location line="-98"/>
<source>Cannot resolve -bind address: &apos;%s&apos;</source>
<translation>Cannot resolve -bind address: &apos;%s&apos;</translation>
</message>
@@ -3065,12 +3080,12 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Done loading</translation>
</message>
<message>
- <location line="+83"/>
+ <location line="+84"/>
<source>To use the %s option</source>
<translation>To use the %s option</translation>
</message>
<message>
- <location line="-75"/>
+ <location line="-76"/>
<source>Error</source>
<translation>Error</translation>
</message>
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index ef72b17201..8953c36579 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -187,6 +187,7 @@ RPCConsole::RPCConsole(QWidget *parent) :
historyPtr(0)
{
ui->setupUi(this);
+ GUIUtil::restoreWindowGeometry("nRPCConsoleWindow", this->size(), this);
#ifndef Q_OS_MAC
ui->openDebugLogfileButton->setIcon(QIcon(":/icons/export"));
@@ -209,6 +210,7 @@ RPCConsole::RPCConsole(QWidget *parent) :
RPCConsole::~RPCConsole()
{
+ GUIUtil::saveWindowGeometry("nRPCConsoleWindow", this);
emit stopExecutor();
delete ui;
}
diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json
index 95664226c5..6964d16a7e 100644
--- a/src/test/data/script_invalid.json
+++ b/src/test/data/script_invalid.json
@@ -13,7 +13,9 @@
["0","NOP"],
["1", "IF VER ELSE 1 ENDIF", "VER non-functional"],
["0", "IF VERIF ELSE 1 ENDIF", "VERIF illegal everywhere"],
-["0", "IF VERNOTIF ELSE 1 ENDIF", "VERNOT illegal everywhere"],
+["0", "IF ELSE 1 ELSE VERIF ENDIF", "VERIF illegal everywhere"],
+["0", "IF VERNOTIF ELSE 1 ENDIF", "VERNOTIF illegal everywhere"],
+["0", "IF ELSE 1 ELSE VERNOTIF ENDIF", "VERNOTIF illegal everywhere"],
["1 IF", "1 ENDIF", "IF/ENDIF can't span scriptSig/scriptPubKey"],
["1 IF 0 ENDIF", "1 ENDIF"],
@@ -36,6 +38,18 @@
["1 1", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"],
["0 0", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"],
+["1", "IF RETURN ELSE ELSE 1 ENDIF", "Multiple ELSEs"],
+["1", "IF 1 ELSE ELSE RETURN ENDIF"],
+
+["1", "ENDIF", "Malformed IF/ELSE/ENDIF sequence"],
+["1", "ELSE ENDIF"],
+["1", "ENDIF ELSE"],
+["1", "ENDIF ELSE IF"],
+["1", "IF ELSE ENDIF ELSE"],
+["1", "IF ELSE ENDIF ELSE ENDIF"],
+["1", "IF ENDIF ENDIF"],
+["1", "IF ELSE ELSE ENDIF ENDIF"],
+
["1", "RETURN"],
["1", "DUP IF RETURN ENDIF"],
diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json
index 58682d3875..cc56a310ae 100644
--- a/src/test/data/script_valid.json
+++ b/src/test/data/script_valid.json
@@ -34,6 +34,21 @@
["1 0", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"],
["0 1", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"],
+["0", "IF 0 ELSE 1 ELSE 0 ENDIF", "Multiple ELSE's are valid and executed inverts on each ELSE encountered"],
+["1", "IF 1 ELSE 0 ELSE ENDIF"],
+["1", "IF ELSE 0 ELSE 1 ENDIF"],
+["1", "IF 1 ELSE 0 ELSE 1 ENDIF ADD 2 EQUAL"],
+["'' 1", "IF SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ENDIF 0x14 0x68ca4fec736264c13b859bac43d5173df6871682 EQUAL"],
+
+["1", "NOTIF 0 ELSE 1 ELSE 0 ENDIF", "Multiple ELSE's are valid and execution inverts on each ELSE encountered"],
+["0", "NOTIF 1 ELSE 0 ELSE ENDIF"],
+["0", "NOTIF ELSE 0 ELSE 1 ENDIF"],
+["0", "NOTIF 1 ELSE 0 ELSE 1 ENDIF ADD 2 EQUAL"],
+["'' 0", "NOTIF SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ENDIF 0x14 0x68ca4fec736264c13b859bac43d5173df6871682 EQUAL"],
+
+["0", "IF 1 IF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 1 IF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL", "Nested ELSE ELSE"],
+["1", "NOTIF 0 NOTIF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 0 NOTIF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL"],
+
["0", "IF RETURN ENDIF 1", "RETURN only works if executed"],
["1 1", "VERIFY"],
diff --git a/src/util.cpp b/src/util.cpp
index c4212b3984..049e55b7d6 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1118,6 +1118,7 @@ boost::filesystem::path GetPidFile()
return pathPidFile;
}
+#ifndef WIN32
void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
{
FILE* file = fopen(path.string().c_str(), "w");
@@ -1127,6 +1128,7 @@ void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
fclose(file);
}
}
+#endif
bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest)
{
diff --git a/src/util.h b/src/util.h
index 9ca73f3311..9aea564406 100644
--- a/src/util.h
+++ b/src/util.h
@@ -207,7 +207,9 @@ boost::filesystem::path GetDefaultDataDir();
const boost::filesystem::path &GetDataDir(bool fNetSpecific = true);
boost::filesystem::path GetConfigFile();
boost::filesystem::path GetPidFile();
+#ifndef WIN32
void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
+#endif
void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
#ifdef WIN32
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true);