aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.qt.include18
-rw-r--r--src/chainparams.cpp1
-rw-r--r--src/chainparams.h4
-rw-r--r--src/init.cpp23
-rw-r--r--src/key.cpp12
-rw-r--r--src/key.h3
-rw-r--r--src/main.cpp9
-rw-r--r--src/main.h7
-rw-r--r--src/miner.cpp1
-rw-r--r--src/miner.h3
-rw-r--r--src/net.cpp25
-rw-r--r--src/net.h6
-rw-r--r--src/qt/bitcoin.cpp1
-rw-r--r--src/qt/bitcoin.qrc73
-rw-r--r--src/qt/bitcoin_locale.qrc75
-rw-r--r--src/qt/coincontroldialog.cpp24
-rw-r--r--src/qt/forms/coincontroldialog.ui2
-rw-r--r--src/qt/forms/optionsdialog.ui10
-rw-r--r--src/qt/forms/sendcoinsdialog.ui2
-rw-r--r--src/qt/optionsdialog.cpp2
-rw-r--r--src/qt/optionsmodel.cpp13
-rw-r--r--src/qt/optionsmodel.h1
-rw-r--r--src/qt/sendcoinsdialog.cpp4
-rw-r--r--src/rpcblockchain.cpp7
-rw-r--r--src/rpcmining.cpp2
-rw-r--r--src/script.cpp4
-rw-r--r--src/script.h11
-rw-r--r--src/util.cpp22
-rw-r--r--src/util.h11
29 files changed, 200 insertions, 176 deletions
diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index 749b976c44..72c7486258 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -152,6 +152,8 @@ QT_MOC = \
QT_QRC_CPP = qt/qrc_bitcoin.cpp
QT_QRC = qt/bitcoin.qrc
+QT_QRC_LOCALE_CPP = qt/qrc_bitcoin_locale.cpp
+QT_QRC_LOCALE = qt/bitcoin_locale.qrc
PROTOBUF_CC = qt/paymentrequest.pb.cc
PROTOBUF_H = qt/paymentrequest.pb.h
@@ -321,10 +323,10 @@ qt_libbitcoinqt_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
$(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)
qt_libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \
- $(QT_QRC) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES)
+ $(QT_QRC) $(QT_QRC_LOCALE) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES)
nodist_qt_libbitcoinqt_a_SOURCES = $(QT_MOC_CPP) $(QT_MOC) $(PROTOBUF_CC) \
- $(PROTOBUF_H) $(QT_QRC_CPP)
+ $(PROTOBUF_H) $(QT_QRC_CPP) $(QT_QRC_LOCALE_CPP)
# forms/foo.h -> forms/ui_foo.h
QT_FORMS_H=$(join $(dir $(QT_FORMS_UI)),$(addprefix ui_, $(notdir $(QT_FORMS_UI:.ui=.h))))
@@ -371,10 +373,16 @@ translate: qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP)
@test -n $(LUPDATE) || echo "lupdate is required for updating translations"
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts qt/locale/bitcoin_en.ts
-$(QT_QRC_CPP): $(QT_QRC) $(QT_QM) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H)
+$(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM)
@test -f $(RCC)
- $(AM_V_GEN) cd $(srcdir); QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin $< | \
- $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $(abs_builddir)/$@
+ @test -f $(@D)/$(<F) || cp -f $< $(@D)
+ $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin_locale $(@D)/$(<F) | \
+ $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@
+
+$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H)
+ @test -f $(RCC)
+ $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin $< | \
+ $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@
CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda qt/*.gcno
diff --git a/src/chainparams.cpp b/src/chainparams.cpp
index 3f4d7f7064..1749dd6ff9 100644
--- a/src/chainparams.cpp
+++ b/src/chainparams.cpp
@@ -212,6 +212,7 @@ public:
vFixedSeeds.clear();
vSeeds.clear();
+ vSeeds.push_back(CDNSSeedData("alexykot.me", "testnet-seed.alexykot.me"));
vSeeds.push_back(CDNSSeedData("bitcoin.petertodd.org", "testnet-seed.bitcoin.petertodd.org"));
vSeeds.push_back(CDNSSeedData("bluematt.me", "testnet-seed.bluematt.me"));
diff --git a/src/chainparams.h b/src/chainparams.h
index 988e3ac3a4..8370cc5690 100644
--- a/src/chainparams.h
+++ b/src/chainparams.h
@@ -6,9 +6,9 @@
#ifndef BITCOIN_CHAIN_PARAMS_H
#define BITCOIN_CHAIN_PARAMS_H
-#include "uint256.h"
#include "core.h"
#include "protocol.h"
+#include "uint256.h"
#include <vector>
@@ -62,7 +62,7 @@ public:
/* Used if GenerateBitcoins is called with a negative number of threads */
int DefaultMinerThreads() const { return nMinerThreads; }
- const CBlock& GenesisBlock() const { return genesis; };
+ const CBlock& GenesisBlock() const { return genesis; }
bool RequireRPCPassword() const { return fRequireRPCPassword; }
/* Make miner wait to have peers to avoid wasting work */
bool MiningRequiresPeers() const { return fMiningRequiresPeers; }
diff --git a/src/init.cpp b/src/init.cpp
index ca348b614e..528c3df064 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -11,6 +11,7 @@
#include "addrman.h"
#include "checkpoints.h"
+#include "key.h"
#include "main.h"
#include "miner.h"
#include "net.h"
@@ -394,6 +395,23 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
}
}
+/** Sanity checks
+ * Ensure that Bitcoin is running in a usable environment with all
+ * necessary library support.
+ */
+bool InitSanityCheck(void)
+{
+ if(!ECC_InitSanityCheck()) {
+ InitError("OpenSSL appears to lack support for elliptic curve cryptography. For more "
+ "information, visit https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries");
+ return false;
+ }
+
+ // TODO: remaining sanity checks, see #4081
+
+ return true;
+}
+
/** Initialize bitcoin.
* @pre Parameters should be parsed and config file should be read.
*/
@@ -598,6 +616,9 @@ bool AppInit2(boost::thread_group& threadGroup)
std::string strWalletFile = GetArg("-wallet", "wallet.dat");
#endif
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log
+ // Sanity check
+ if (!InitSanityCheck())
+ return InitError(_("Initialization sanity check failed. Bitcoin Core is shutting down."));
std::string strDataDir = GetDataDir().string();
#ifdef ENABLE_WALLET
@@ -745,7 +766,7 @@ bool AppInit2(boost::thread_group& threadGroup)
}
// see Step 2: parameter interactions for more information about these
- fListen = GetBoolArg("-listen", true);
+ fListen = GetBoolArg("-listen", DEFAULT_LISTEN);
fDiscover = GetBoolArg("-discover", true);
fNameLookup = GetBoolArg("-dns", true);
diff --git a/src/key.cpp b/src/key.cpp
index aa24f0a622..4747beffb4 100644
--- a/src/key.cpp
+++ b/src/key.cpp
@@ -631,3 +631,15 @@ bool CExtPubKey::Derive(CExtPubKey &out, unsigned int nChild) const {
out.nChild = nChild;
return pubkey.Derive(out.pubkey, out.vchChainCode, nChild, vchChainCode);
}
+
+bool ECC_InitSanityCheck() {
+ EC_KEY *pkey = EC_KEY_new_by_curve_name(NID_secp256k1);
+ if(pkey == NULL)
+ return false;
+ EC_KEY_free(pkey);
+
+ // TODO Is there more EC functionality that could be missing?
+ return true;
+}
+
+
diff --git a/src/key.h b/src/key.h
index 983775fd23..11dc65de8c 100644
--- a/src/key.h
+++ b/src/key.h
@@ -306,4 +306,7 @@ struct CExtKey {
void SetMaster(const unsigned char *seed, unsigned int nSeedLen);
};
+/** Check that required EC support is available at runtime */
+bool ECC_InitSanityCheck(void);
+
#endif
diff --git a/src/main.cpp b/src/main.cpp
index dd33f443bf..98e1741954 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1985,7 +1985,7 @@ bool static DisconnectTip(CValidationState &state) {
BOOST_FOREACH(const CTransaction &tx, block.vtx) {
// ignore validation errors in resurrected transactions
list<CTransaction> removed;
- CValidationState stateDummy;
+ CValidationState stateDummy;
if (!tx.IsCoinBase())
if (!AcceptToMemoryPool(mempool, stateDummy, tx, false, NULL))
mempool.remove(tx, removed, true);
@@ -2213,7 +2213,6 @@ CBlockIndex* AddToBlockIndex(CBlockHeader& block)
return pindexNew;
}
-
// Mark a block as having its data received and checked (up to BLOCK_VALID_TRANSACTIONS).
bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBlockIndex *pindexNew, const CDiskBlockPos& pos)
{
@@ -2246,7 +2245,6 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl
return true;
}
-
bool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAddSize, unsigned int nHeight, uint64_t nTime, bool fKnown = false)
{
bool fUpdatedLast = false;
@@ -2341,7 +2339,6 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne
return true;
}
-
bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW)
{
// Check proof of work matches claimed amount
@@ -4454,8 +4451,8 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
// in flight for over two minutes, since we first had a chance to
// process an incoming block.
int64_t nNow = GetTimeMicros();
- if (!pto->fDisconnect && state.nBlocksInFlight &&
- state.nLastBlockReceive < state.nLastBlockProcess - BLOCK_DOWNLOAD_TIMEOUT*1000000 &&
+ if (!pto->fDisconnect && state.nBlocksInFlight &&
+ state.nLastBlockReceive < state.nLastBlockProcess - BLOCK_DOWNLOAD_TIMEOUT*1000000 &&
state.vBlocksInFlight.front().nTime < state.nLastBlockProcess - 2*BLOCK_DOWNLOAD_TIMEOUT*1000000) {
LogPrintf("Peer %s is stalling block download, disconnecting\n", state.name.c_str());
pto->fDisconnect = true;
diff --git a/src/main.h b/src/main.h
index 4ef3800084..5a0aedcde1 100644
--- a/src/main.h
+++ b/src/main.h
@@ -66,12 +66,6 @@ static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 128;
/** Timeout in seconds before considering a block download peer unresponsive. */
static const unsigned int BLOCK_DOWNLOAD_TIMEOUT = 60;
-#ifdef USE_UPNP
-static const int fHaveUPnP = true;
-#else
-static const int fHaveUPnP = false;
-#endif
-
/** "reject" message codes **/
static const unsigned char REJECT_MALFORMED = 0x01;
static const unsigned char REJECT_INVALID = 0x10;
@@ -1019,7 +1013,6 @@ public:
/** RAII wrapper for VerifyDB: Verify consistency of the block and coin databases */
class CVerifyDB {
public:
-
CVerifyDB();
~CVerifyDB();
bool VerifyDB(int nCheckLevel, int nCheckDepth);
diff --git a/src/miner.cpp b/src/miner.cpp
index 68abc4a6ef..a0a728fb81 100644
--- a/src/miner.cpp
+++ b/src/miner.cpp
@@ -677,4 +677,3 @@ void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads)
}
#endif
-
diff --git a/src/miner.h b/src/miner.h
index 26151f6cd5..dcd61d8fd9 100644
--- a/src/miner.h
+++ b/src/miner.h
@@ -10,11 +10,12 @@
class CBlock;
class CBlockIndex;
-struct CBlockTemplate;
class CReserveKey;
class CScript;
class CWallet;
+struct CBlockTemplate;
+
/** Run the miner threads */
void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads);
/** Generate a new block, without valid proof-of-work */
diff --git a/src/net.cpp b/src/net.cpp
index fe6e9337ae..757a06aaed 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -469,11 +469,10 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest)
}
}
-
/// debug print
LogPrint("net", "trying connection %s lastseen=%.1fhrs\n",
pszDest ? pszDest : addrConnect.ToString(),
- pszDest ? 0 : (double)(GetAdjustedTime() - addrConnect.nTime)/3600.0);
+ pszDest ? 0.0 : (double)(GetAdjustedTime() - addrConnect.nTime)/3600.0);
// Connect
SOCKET hSocket;
@@ -505,10 +504,8 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest)
pnode->nTimeConnected = GetTime();
return pnode;
}
- else
- {
- return NULL;
- }
+
+ return NULL;
}
void CNode::CloseSocketDisconnect()
@@ -535,7 +532,6 @@ void CNode::Cleanup()
{
}
-
void CNode::PushVersion()
{
int nBestHeight = g_signals.GetHeight().get_value_or(0);
@@ -1429,21 +1425,21 @@ void ThreadOpenAddedConnections()
}
// if successful, this moves the passed grant to the constructed node
-bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound, const char *strDest, bool fOneShot)
+bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound, const char *pszDest, bool fOneShot)
{
//
// Initiate outbound network connection
//
boost::this_thread::interruption_point();
- if (!strDest)
+ if (!pszDest) {
if (IsLocal(addrConnect) ||
FindNode((CNetAddr)addrConnect) || CNode::IsBanned(addrConnect) ||
FindNode(addrConnect.ToStringIPPort().c_str()))
return false;
- if (strDest && FindNode(strDest))
+ } else if (FindNode(pszDest))
return false;
- CNode* pnode = ConnectNode(addrConnect, strDest);
+ CNode* pnode = ConnectNode(addrConnect, pszDest);
boost::this_thread::interruption_point();
if (!pnode)
@@ -1579,7 +1575,7 @@ bool BindListenPort(const CService &addrBind, string& strError)
socklen_t len = sizeof(sockaddr);
if (!addrBind.GetSockAddr((struct sockaddr*)&sockaddr, &len))
{
- strError = strprintf("Error: bind address family for %s not supported", addrBind.ToString());
+ strError = strprintf("Error: Bind address family for %s not supported", addrBind.ToString());
LogPrintf("%s\n", strError);
return false;
}
@@ -1773,9 +1769,8 @@ bool StopNode()
class CNetCleanup
{
public:
- CNetCleanup()
- {
- }
+ CNetCleanup() {}
+
~CNetCleanup()
{
// Close sockets
diff --git a/src/net.h b/src/net.h
index 7a77e55a14..14d578a72a 100644
--- a/src/net.h
+++ b/src/net.h
@@ -43,6 +43,8 @@ static const int PING_INTERVAL = 2 * 60;
static const int TIMEOUT_INTERVAL = 20 * 60;
/** The maximum number of entries in an 'inv' protocol message */
static const unsigned int MAX_INV_SZ = 50000;
+/** -listen default */
+static const bool DEFAULT_LISTEN = true;
/** -upnp default */
#ifdef USE_UPNP
static const bool DEFAULT_UPNP = USE_UPNP;
@@ -59,11 +61,11 @@ bool GetMyExternalIP(CNetAddr& ipRet);
void AddressCurrentlyConnected(const CService& addr);
CNode* FindNode(const CNetAddr& ip);
CNode* FindNode(const CService& ip);
-CNode* ConnectNode(CAddress addrConnect, const char *strDest = NULL);
+CNode* ConnectNode(CAddress addrConnect, const char *pszDest = NULL);
bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false);
void MapPort(bool fUseUPnP);
unsigned short GetListenPort();
-bool BindListenPort(const CService &bindAddr, std::string& strError=REF(std::string()));
+bool BindListenPort(const CService &bindAddr, std::string& strError);
void StartNode(boost::thread_group& threadGroup);
bool StopNode();
void SocketSendData(CNode *pnode);
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index 45d7a52889..2be8191eb5 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -475,6 +475,7 @@ int main(int argc, char *argv[])
#endif
Q_INIT_RESOURCE(bitcoin);
+ Q_INIT_RESOURCE(bitcoin_locale);
BitcoinApplication app(argc, argv);
#if QT_VERSION > 0x050100
// Generate high-dpi pixmaps
diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc
index e1c739b022..f38200c7f7 100644
--- a/src/qt/bitcoin.qrc
+++ b/src/qt/bitcoin.qrc
@@ -84,77 +84,4 @@
<file alias="spinner-033">res/movies/spinner-033.png</file>
<file alias="spinner-034">res/movies/spinner-034.png</file>
</qresource>
- <qresource prefix="/translations">
- <file alias="ach">locale/bitcoin_ach.qm</file>
- <file alias="af_ZA">locale/bitcoin_af_ZA.qm</file>
- <file alias="ar">locale/bitcoin_ar.qm</file>
- <file alias="be_BY">locale/bitcoin_be_BY.qm</file>
- <file alias="bg">locale/bitcoin_bg.qm</file>
- <file alias="bs">locale/bitcoin_bs.qm</file>
- <file alias="ca_ES">locale/bitcoin_ca_ES.qm</file>
- <file alias="ca">locale/bitcoin_ca.qm</file>
- <file alias="ca@valencia">locale/bitcoin_ca@valencia.qm</file>
- <file alias="cmn">locale/bitcoin_cmn.qm</file>
- <file alias="cs">locale/bitcoin_cs.qm</file>
- <file alias="cy">locale/bitcoin_cy.qm</file>
- <file alias="da">locale/bitcoin_da.qm</file>
- <file alias="de">locale/bitcoin_de.qm</file>
- <file alias="el_GR">locale/bitcoin_el_GR.qm</file>
- <file alias="en">locale/bitcoin_en.qm</file>
- <file alias="eo">locale/bitcoin_eo.qm</file>
- <file alias="es_CL">locale/bitcoin_es_CL.qm</file>
- <file alias="es_DO">locale/bitcoin_es_DO.qm</file>
- <file alias="es_MX">locale/bitcoin_es_MX.qm</file>
- <file alias="es">locale/bitcoin_es.qm</file>
- <file alias="es_UY">locale/bitcoin_es_UY.qm</file>
- <file alias="et">locale/bitcoin_et.qm</file>
- <file alias="eu_ES">locale/bitcoin_eu_ES.qm</file>
- <file alias="fa_IR">locale/bitcoin_fa_IR.qm</file>
- <file alias="fa">locale/bitcoin_fa.qm</file>
- <file alias="fi">locale/bitcoin_fi.qm</file>
- <file alias="fr_CA">locale/bitcoin_fr_CA.qm</file>
- <file alias="fr">locale/bitcoin_fr.qm</file>
- <file alias="gl">locale/bitcoin_gl.qm</file>
- <file alias="gu_IN">locale/bitcoin_gu_IN.qm</file>
- <file alias="he">locale/bitcoin_he.qm</file>
- <file alias="hi_IN">locale/bitcoin_hi_IN.qm</file>
- <file alias="hr">locale/bitcoin_hr.qm</file>
- <file alias="hu">locale/bitcoin_hu.qm</file>
- <file alias="id_ID">locale/bitcoin_id_ID.qm</file>
- <file alias="it">locale/bitcoin_it.qm</file>
- <file alias="ja">locale/bitcoin_ja.qm</file>
- <file alias="ka">locale/bitcoin_ka.qm</file>
- <file alias="kk_KZ">locale/bitcoin_kk_KZ.qm</file>
- <file alias="ko_KR">locale/bitcoin_ko_KR.qm</file>
- <file alias="ky">locale/bitcoin_ky.qm</file>
- <file alias="la">locale/bitcoin_la.qm</file>
- <file alias="lt">locale/bitcoin_lt.qm</file>
- <file alias="lv_LV">locale/bitcoin_lv_LV.qm</file>
- <file alias="mn">locale/bitcoin_mn.qm</file>
- <file alias="ms_MY">locale/bitcoin_ms_MY.qm</file>
- <file alias="nb">locale/bitcoin_nb.qm</file>
- <file alias="nl">locale/bitcoin_nl.qm</file>
- <file alias="pam">locale/bitcoin_pam.qm</file>
- <file alias="pl">locale/bitcoin_pl.qm</file>
- <file alias="pt_BR">locale/bitcoin_pt_BR.qm</file>
- <file alias="pt_PT">locale/bitcoin_pt_PT.qm</file>
- <file alias="ro_RO">locale/bitcoin_ro_RO.qm</file>
- <file alias="ru">locale/bitcoin_ru.qm</file>
- <file alias="sah">locale/bitcoin_sah.qm</file>
- <file alias="sk">locale/bitcoin_sk.qm</file>
- <file alias="sl_SI">locale/bitcoin_sl_SI.qm</file>
- <file alias="sq">locale/bitcoin_sq.qm</file>
- <file alias="sr">locale/bitcoin_sr.qm</file>
- <file alias="sv">locale/bitcoin_sv.qm</file>
- <file alias="th_TH">locale/bitcoin_th_TH.qm</file>
- <file alias="tr">locale/bitcoin_tr.qm</file>
- <file alias="uk">locale/bitcoin_uk.qm</file>
- <file alias="ur_PK">locale/bitcoin_ur_PK.qm</file>
- <file alias="uz@Cyrl">locale/bitcoin_uz@Cyrl.qm</file>
- <file alias="vi">locale/bitcoin_vi.qm</file>
- <file alias="vi_VN">locale/bitcoin_vi_VN.qm</file>
- <file alias="zh_CN">locale/bitcoin_zh_CN.qm</file>
- <file alias="zh_HK">locale/bitcoin_zh_HK.qm</file>
- <file alias="zh_TW">locale/bitcoin_zh_TW.qm</file>
- </qresource>
</RCC>
diff --git a/src/qt/bitcoin_locale.qrc b/src/qt/bitcoin_locale.qrc
new file mode 100644
index 0000000000..b70a107397
--- /dev/null
+++ b/src/qt/bitcoin_locale.qrc
@@ -0,0 +1,75 @@
+<!DOCTYPE RCC><RCC version="1.0">
+ <qresource prefix="/translations">
+ <file alias="ach">locale/bitcoin_ach.qm</file>
+ <file alias="af_ZA">locale/bitcoin_af_ZA.qm</file>
+ <file alias="ar">locale/bitcoin_ar.qm</file>
+ <file alias="be_BY">locale/bitcoin_be_BY.qm</file>
+ <file alias="bg">locale/bitcoin_bg.qm</file>
+ <file alias="bs">locale/bitcoin_bs.qm</file>
+ <file alias="ca_ES">locale/bitcoin_ca_ES.qm</file>
+ <file alias="ca">locale/bitcoin_ca.qm</file>
+ <file alias="ca@valencia">locale/bitcoin_ca@valencia.qm</file>
+ <file alias="cmn">locale/bitcoin_cmn.qm</file>
+ <file alias="cs">locale/bitcoin_cs.qm</file>
+ <file alias="cy">locale/bitcoin_cy.qm</file>
+ <file alias="da">locale/bitcoin_da.qm</file>
+ <file alias="de">locale/bitcoin_de.qm</file>
+ <file alias="el_GR">locale/bitcoin_el_GR.qm</file>
+ <file alias="en">locale/bitcoin_en.qm</file>
+ <file alias="eo">locale/bitcoin_eo.qm</file>
+ <file alias="es_CL">locale/bitcoin_es_CL.qm</file>
+ <file alias="es_DO">locale/bitcoin_es_DO.qm</file>
+ <file alias="es_MX">locale/bitcoin_es_MX.qm</file>
+ <file alias="es">locale/bitcoin_es.qm</file>
+ <file alias="es_UY">locale/bitcoin_es_UY.qm</file>
+ <file alias="et">locale/bitcoin_et.qm</file>
+ <file alias="eu_ES">locale/bitcoin_eu_ES.qm</file>
+ <file alias="fa_IR">locale/bitcoin_fa_IR.qm</file>
+ <file alias="fa">locale/bitcoin_fa.qm</file>
+ <file alias="fi">locale/bitcoin_fi.qm</file>
+ <file alias="fr_CA">locale/bitcoin_fr_CA.qm</file>
+ <file alias="fr">locale/bitcoin_fr.qm</file>
+ <file alias="gl">locale/bitcoin_gl.qm</file>
+ <file alias="gu_IN">locale/bitcoin_gu_IN.qm</file>
+ <file alias="he">locale/bitcoin_he.qm</file>
+ <file alias="hi_IN">locale/bitcoin_hi_IN.qm</file>
+ <file alias="hr">locale/bitcoin_hr.qm</file>
+ <file alias="hu">locale/bitcoin_hu.qm</file>
+ <file alias="id_ID">locale/bitcoin_id_ID.qm</file>
+ <file alias="it">locale/bitcoin_it.qm</file>
+ <file alias="ja">locale/bitcoin_ja.qm</file>
+ <file alias="ka">locale/bitcoin_ka.qm</file>
+ <file alias="kk_KZ">locale/bitcoin_kk_KZ.qm</file>
+ <file alias="ko_KR">locale/bitcoin_ko_KR.qm</file>
+ <file alias="ky">locale/bitcoin_ky.qm</file>
+ <file alias="la">locale/bitcoin_la.qm</file>
+ <file alias="lt">locale/bitcoin_lt.qm</file>
+ <file alias="lv_LV">locale/bitcoin_lv_LV.qm</file>
+ <file alias="mn">locale/bitcoin_mn.qm</file>
+ <file alias="ms_MY">locale/bitcoin_ms_MY.qm</file>
+ <file alias="nb">locale/bitcoin_nb.qm</file>
+ <file alias="nl">locale/bitcoin_nl.qm</file>
+ <file alias="pam">locale/bitcoin_pam.qm</file>
+ <file alias="pl">locale/bitcoin_pl.qm</file>
+ <file alias="pt_BR">locale/bitcoin_pt_BR.qm</file>
+ <file alias="pt_PT">locale/bitcoin_pt_PT.qm</file>
+ <file alias="ro_RO">locale/bitcoin_ro_RO.qm</file>
+ <file alias="ru">locale/bitcoin_ru.qm</file>
+ <file alias="sah">locale/bitcoin_sah.qm</file>
+ <file alias="sk">locale/bitcoin_sk.qm</file>
+ <file alias="sl_SI">locale/bitcoin_sl_SI.qm</file>
+ <file alias="sq">locale/bitcoin_sq.qm</file>
+ <file alias="sr">locale/bitcoin_sr.qm</file>
+ <file alias="sv">locale/bitcoin_sv.qm</file>
+ <file alias="th_TH">locale/bitcoin_th_TH.qm</file>
+ <file alias="tr">locale/bitcoin_tr.qm</file>
+ <file alias="uk">locale/bitcoin_uk.qm</file>
+ <file alias="ur_PK">locale/bitcoin_ur_PK.qm</file>
+ <file alias="uz@Cyrl">locale/bitcoin_uz@Cyrl.qm</file>
+ <file alias="vi">locale/bitcoin_vi.qm</file>
+ <file alias="vi_VN">locale/bitcoin_vi_VN.qm</file>
+ <file alias="zh_CN">locale/bitcoin_zh_CN.qm</file>
+ <file alias="zh_HK">locale/bitcoin_zh_HK.qm</file>
+ <file alias="zh_TW">locale/bitcoin_zh_TW.qm</file>
+ </qresource>
+</RCC>
diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp
index e27f1bff97..42d6da7d37 100644
--- a/src/qt/coincontroldialog.cpp
+++ b/src/qt/coincontroldialog.cpp
@@ -71,7 +71,7 @@ CoinControlDialog::CoinControlDialog(QWidget *parent) :
QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this);
QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this);
QAction *clipboardPriorityAction = new QAction(tr("Copy priority"), this);
- QAction *clipboardLowOutputAction = new QAction(tr("Copy low output"), this);
+ QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this);
QAction *clipboardChangeAction = new QAction(tr("Copy change"), this);
connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(clipboardQuantity()));
@@ -309,7 +309,7 @@ void CoinControlDialog::clipboardPriority()
GUIUtil::setClipboard(ui->labelCoinControlPriority->text());
}
-// copy label "Low output" to clipboard
+// copy label "Dust" to clipboard
void CoinControlDialog::clipboardLowOutput()
{
GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text());
@@ -439,7 +439,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
// nPayAmount
qint64 nPayAmount = 0;
- bool fLowOutput = false;
bool fDust = false;
CTransaction txDummy;
foreach(const qint64 &amount, CoinControlDialog::payAmounts)
@@ -448,9 +447,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
if (amount > 0)
{
- if (amount < CENT)
- fLowOutput = true;
-
CTxOut txout(amount, (CScript)vector<unsigned char>(24, 0));
txDummy.vout.push_back(txout);
if (txout.IsDust(CTransaction::minRelayTxFee))
@@ -571,7 +567,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
QLabel *l7 = dialog->findChild<QLabel *>("labelCoinControlLowOutput");
QLabel *l8 = dialog->findChild<QLabel *>("labelCoinControlChange");
- // enable/disable "low output" and "change"
+ // enable/disable "dust" and "change"
dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setEnabled(nPayAmount > 0);
dialog->findChild<QLabel *>("labelCoinControlLowOutput") ->setEnabled(nPayAmount > 0);
dialog->findChild<QLabel *>("labelCoinControlChangeText") ->setEnabled(nPayAmount > 0);
@@ -584,14 +580,13 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
l4->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAfterFee)); // After Fee
l5->setText(((nBytes > 0) ? "~" : "") + QString::number(nBytes)); // Bytes
l6->setText(sPriorityLabel); // Priority
- l7->setText((fLowOutput ? (fDust ? tr("Dust") : tr("yes")) : tr("no"))); // Low Output / Dust
+ l7->setText(fDust ? tr("yes") : tr("no")); // Dust
l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange)); // Change
// turn labels "red"
l5->setStyleSheet((nBytes >= 1000) ? "color:red;" : ""); // Bytes >= 1000
l6->setStyleSheet((dPriority > 0 && !AllowFree(dPriority)) ? "color:red;" : ""); // Priority < "medium"
- l7->setStyleSheet((fLowOutput) ? "color:red;" : ""); // Low Output = "yes"
- l8->setStyleSheet((nChange > 0 && nChange < CENT) ? "color:red;" : ""); // Change < 0.01BTC
+ l7->setStyleSheet((fDust) ? "color:red;" : ""); // Dust = "yes"
// tool tips
QString toolTip1 = tr("This label turns red, if the transaction size is greater than 1000 bytes.") + "<br /><br />";
@@ -602,21 +597,14 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
toolTip2 += tr("This label turns red, if the priority is smaller than \"medium\".") + "<br /><br />";
toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK()));
- QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "<br /><br />";
- toolTip3 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK())) + "<br /><br />";
- toolTip3 += tr("Amounts below 0.546 times the minimum relay fee are shown as dust.");
-
- QString toolTip4 = tr("This label turns red, if the change is smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "<br /><br />";
- toolTip4 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK()));
+ QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minRelayTxFee.GetFee(546)));
l5->setToolTip(toolTip1);
l6->setToolTip(toolTip2);
l7->setToolTip(toolTip3);
- l8->setToolTip(toolTip4);
dialog->findChild<QLabel *>("labelCoinControlBytesText") ->setToolTip(l5->toolTip());
dialog->findChild<QLabel *>("labelCoinControlPriorityText") ->setToolTip(l6->toolTip());
dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setToolTip(l7->toolTip());
- dialog->findChild<QLabel *>("labelCoinControlChangeText") ->setToolTip(l8->toolTip());
// Insufficient funds
QLabel *label = dialog->findChild<QLabel *>("labelCoinControlInsuffFunds");
diff --git a/src/qt/forms/coincontroldialog.ui b/src/qt/forms/coincontroldialog.ui
index cd1c0ffa18..67ea3a9d8c 100644
--- a/src/qt/forms/coincontroldialog.ui
+++ b/src/qt/forms/coincontroldialog.ui
@@ -225,7 +225,7 @@
</font>
</property>
<property name="text">
- <string>Low Output:</string>
+ <string>Dust:</string>
</property>
</widget>
</item>
diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui
index 0103842e02..0c5b8895aa 100644
--- a/src/qt/forms/optionsdialog.ui
+++ b/src/qt/forms/optionsdialog.ui
@@ -243,6 +243,16 @@
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="allowIncoming">
+ <property name="toolTip">
+ <string>Accept connections from outside</string>
+ </property>
+ <property name="text">
+ <string>Allow incoming connections</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QCheckBox" name="connectSocks">
<property name="toolTip">
<string>Connect to the Bitcoin network through a SOCKS proxy.</string>
diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui
index 4cb1670c79..a631b04670 100644
--- a/src/qt/forms/sendcoinsdialog.ui
+++ b/src/qt/forms/sendcoinsdialog.ui
@@ -417,7 +417,7 @@
</font>
</property>
<property name="text">
- <string>Low Output:</string>
+ <string>Dust:</string>
</property>
</widget>
</item>
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index 1cbf5f8810..abfd4123e0 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -151,6 +151,7 @@ void OptionsDialog::setModel(OptionsModel *model)
/* Wallet */
connect(ui->spendZeroConfChange, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning()));
/* Network */
+ connect(ui->allowIncoming, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning()));
connect(ui->connectSocks, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning()));
/* Display */
connect(ui->lang, SIGNAL(valueChanged()), this, SLOT(showRestartWarning()));
@@ -171,6 +172,7 @@ void OptionsDialog::setMapper()
/* Network */
mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
+ mapper->addMapping(ui->allowIncoming, OptionsModel::Listen);
mapper->addMapping(ui->connectSocks, OptionsModel::ProxyUse);
mapper->addMapping(ui->proxyIp, OptionsModel::ProxyIP);
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index f3a5f37bb3..4dafd9d2af 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -110,6 +110,11 @@ void OptionsModel::Init()
if (!SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool()))
addOverriddenOption("-upnp");
+ if (!settings.contains("fListen"))
+ settings.setValue("fListen", DEFAULT_LISTEN);
+ if (!SoftSetBoolArg("-listen", settings.value("fListen").toBool()))
+ addOverriddenOption("-listen");
+
if (!settings.contains("fUseProxy"))
settings.setValue("fUseProxy", false);
if (!settings.contains("addrProxy"))
@@ -214,6 +219,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
return settings.value("nDatabaseCache");
case ThreadsScriptVerif:
return settings.value("nThreadsScriptVerif");
+ case Listen:
+ return settings.value("fListen");
default:
return QVariant();
}
@@ -339,6 +346,12 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
setRestartRequired(true);
}
break;
+ case Listen:
+ if (settings.value("fListen") != value) {
+ settings.setValue("fListen", value);
+ setRestartRequired(true);
+ }
+ break;
default:
break;
}
diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h
index f05e3e92de..2596682d07 100644
--- a/src/qt/optionsmodel.h
+++ b/src/qt/optionsmodel.h
@@ -42,6 +42,7 @@ public:
ThreadsScriptVerif, // int
DatabaseCache, // int
SpendZeroConfChange, // bool
+ Listen, // bool
OptionIDRowCount,
};
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp
index 23b8ef83e2..b7d74d7039 100644
--- a/src/qt/sendcoinsdialog.cpp
+++ b/src/qt/sendcoinsdialog.cpp
@@ -53,7 +53,7 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this);
QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this);
QAction *clipboardPriorityAction = new QAction(tr("Copy priority"), this);
- QAction *clipboardLowOutputAction = new QAction(tr("Copy low output"), this);
+ QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this);
QAction *clipboardChangeAction = new QAction(tr("Copy change"), this);
connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardQuantity()));
connect(clipboardAmountAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAmount()));
@@ -478,7 +478,7 @@ void SendCoinsDialog::coinControlClipboardPriority()
GUIUtil::setClipboard(ui->labelCoinControlPriority->text());
}
-// Coin Control: copy label "Low output" to clipboard
+// Coin Control: copy label "Dust" to clipboard
void SendCoinsDialog::coinControlClipboardLowOutput()
{
GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text());
diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp
index ff5057b526..2a21fb462a 100644
--- a/src/rpcblockchain.cpp
+++ b/src/rpcblockchain.cpp
@@ -3,10 +3,10 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#include "rpcserver.h"
+#include "checkpoints.h"
#include "main.h"
+#include "rpcserver.h"
#include "sync.h"
-#include "checkpoints.h"
#include <stdint.h>
@@ -450,9 +450,6 @@ Value getblockchaininfo(const Array& params, bool fHelp)
+ HelpExampleRpc("getblockchaininfo", "")
);
- proxyType proxy;
- GetProxy(NET_IPV4, proxy);
-
Object obj;
std::string chain = Params().DataDir();
if(chain.empty())
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp
index 837f5336c4..3caf7d89fe 100644
--- a/src/rpcmining.cpp
+++ b/src/rpcmining.cpp
@@ -13,9 +13,11 @@
#include "db.h"
#include "wallet.h"
#endif
+
#include <stdint.h>
#include <boost/assign/list_of.hpp>
+
#include "json/json_spirit_utils.h"
#include "json/json_spirit_value.h"
diff --git a/src/script.cpp b/src/script.cpp
index 381e84d0b7..11cdfef950 100644
--- a/src/script.cpp
+++ b/src/script.cpp
@@ -838,10 +838,6 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
valtype& vchSig = stacktop(-2);
valtype& vchPubKey = stacktop(-1);
- ////// debug print
- //PrintHex(vchSig.begin(), vchSig.end(), "sig: %s\n");
- //PrintHex(vchPubKey.begin(), vchPubKey.end(), "pubkey: %s\n");
-
// Subset of script starting at the most recent codeseparator
CScript scriptCode(pbegincodehash, pend);
diff --git a/src/script.h b/src/script.h
index aed2b7a6ad..a282e7dc04 100644
--- a/src/script.h
+++ b/src/script.h
@@ -691,12 +691,6 @@ public:
void SetDestination(const CTxDestination& address);
void SetMultisig(int nRequired, const std::vector<CPubKey>& keys);
-
- void PrintHex() const
- {
- LogPrintf("CScript(%s)\n", HexStr(begin(), end(), true).c_str());
- }
-
std::string ToString() const
{
std::string str;
@@ -720,11 +714,6 @@ public:
return str;
}
- void print() const
- {
- LogPrintf("%s\n", ToString());
- }
-
CScriptID GetID() const
{
return CScriptID(Hash160(*this));
diff --git a/src/util.cpp b/src/util.cpp
index d106b03230..cccf2df484 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -962,13 +962,15 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific)
void ClearDatadirCache()
{
std::fill(&pathCached[0], &pathCached[CChainParams::MAX_NETWORK_TYPES+1],
- boost::filesystem::path());
+ boost::filesystem::path());
}
boost::filesystem::path GetConfigFile()
{
boost::filesystem::path pathConfigFile(GetArg("-conf", "bitcoin.conf"));
- if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir(false) / pathConfigFile;
+ if (!pathConfigFile.is_complete())
+ pathConfigFile = GetDataDir(false) / pathConfigFile;
+
return pathConfigFile;
}
@@ -1028,9 +1030,9 @@ bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest)
#endif /* WIN32 */
}
-
-// Ignores exceptions thrown by boost's create_directory if the requested directory exists.
-// Specifically handles case where path p exists, but it wasn't possible for the user to write to the parent directory.
+// Ignores exceptions thrown by Boost's create_directory if the requested directory exists.
+// Specifically handles case where path p exists, but it wasn't possible for the user to
+// write to the parent directory.
bool TryCreateDirectory(const boost::filesystem::path& p)
{
try
@@ -1381,19 +1383,19 @@ bool ParseInt32(const std::string& str, int32_t *out)
void SetupEnvironment()
{
- #ifndef WIN32
+#ifndef WIN32
try
{
- #if BOOST_FILESYSTEM_VERSION == 3
+#if BOOST_FILESYSTEM_VERSION == 3
boost::filesystem::path::codecvt(); // Raises runtime error if current locale is invalid
- #else // boost filesystem v2
+#else // boost filesystem v2
std::locale(); // Raises runtime error if current locale is invalid
- #endif
+#endif
} catch(std::runtime_error &e)
{
setenv("LC_ALL", "C", 1); // Force C locale
}
- #endif
+#endif
}
std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime)
diff --git a/src/util.h b/src/util.h
index b09f9bb15e..e070365790 100644
--- a/src/util.h
+++ b/src/util.h
@@ -286,17 +286,6 @@ inline std::string HexStr(const T& vch, bool fSpaces=false)
return HexStr(vch.begin(), vch.end(), fSpaces);
}
-template<typename T>
-void PrintHex(const T pbegin, const T pend, const char* pszFormat="%s", bool fSpaces=true)
-{
- LogPrintf(pszFormat, HexStr(pbegin, pend, fSpaces).c_str());
-}
-
-inline void PrintHex(const std::vector<unsigned char>& vch, const char* pszFormat="%s", bool fSpaces=true)
-{
- LogPrintf(pszFormat, HexStr(vch, fSpaces).c_str());
-}
-
inline int64_t GetPerformanceCounter()
{
int64_t nCounter = 0;