aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
l---------README1
-rw-r--r--README.md110
-rw-r--r--bitcoin-qt.pro2
-rw-r--r--contrib/macdeploy/notes.txt2
-rwxr-xr-xcontrib/verifysfbinaries/verify.sh4
-rw-r--r--doc/files.txt19
-rw-r--r--src/checkpoints.cpp1
-rw-r--r--src/init.cpp6
-rw-r--r--src/main.cpp74
-rw-r--r--src/main.h4
-rw-r--r--src/makefile.unix2
-rw-r--r--src/net.cpp47
-rw-r--r--src/qt/aboutdialog.cpp8
-rw-r--r--src/qt/aboutdialog.h1
-rw-r--r--src/qt/bitcoinstrings.cpp14
-rw-r--r--src/qt/clientmodel.cpp5
-rw-r--r--src/qt/forms/aboutdialog.ui5
-rw-r--r--src/qt/locale/bitcoin_en.ts171
-rw-r--r--src/rpcrawtransaction.cpp16
-rw-r--r--src/test/test_bitcoin.cpp2
-rw-r--r--src/wallet.cpp2
21 files changed, 333 insertions, 163 deletions
diff --git a/README b/README
deleted file mode 120000
index 42061c01a1..0000000000
--- a/README
+++ /dev/null
@@ -1 +0,0 @@
-README.md \ No newline at end of file
diff --git a/README.md b/README.md
index 1ecb8c7efe..58dc2969a6 100644
--- a/README.md
+++ b/README.md
@@ -1,66 +1,82 @@
-
Bitcoin integration/staging tree
+================================
+
+http://www.bitcoin.org
+
+Copyright (c) 2009-2012 Bitcoin Developers
+
+What is Bitcoin?
+----------------
+
+Bitcoin is an experimental new digital currency that enables instant payments to
+anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate
+with no central authority: managing transactions and issuing money are carried
+out collectively by the network. Bitcoin is also the name of the open source
+software which enables the use of this currency.
+
+For more information, as well as an immediately useable, binary version of
+the Bitcoin client sofware, see http://www.bitcoin.org.
+
+License
+-------
+
+Bitcoin is released under the terms of the MIT license. See `COPYING` for more
+information or see http://opensource.org/licenses/MIT.
Development process
-===================
+-------------------
-Developers work in their own trees, then submit pull requests when
-they think their feature or bug fix is ready.
+Developers work in their own trees, then submit pull requests when they think
+their feature or bug fix is ready.
-If it is a simple/trivial/non-controversial change, then one of the
-bitcoin development team members simply pulls it.
+If it is a simple/trivial/non-controversial change, then one of the Bitcoin
+development team members simply pulls it.
-If it is a more complicated or potentially controversial
-change, then the patch submitter will be asked to start a
-discussion (if they haven't already) on the mailing list:
-http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development
+If it is a *more complicated or potentially controversial* change, then the patch
+submitter will be asked to start a discussion (if they haven't already) on the
+[mailing list](http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development).
-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 they don't match the project's coding conventions (see coding.txt)
-or are controversial.
+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
+controversial.
-The master branch is regularly built and tested, but is not guaranteed
-to be completely stable. Tags are regularly created to indicate new
-official, stable release versions of Bitcoin.
+The `master` branch is regularly built and tested, but is not guaranteed to be
+completely stable. [Tags](https://github.com/bitcoin/bitcoin/tags) are created
+regularly to indicate new official, stable release versions of Bitcoin.
Testing
-=======
+-------
+
+Testing and code review is the bottleneck for development; we get more pull
+requests than we can review and test. Please be patient and help out, and
+remember this is a security-critical project where any mistake might cost people
+lots of money.
+
+### Automated Testing
-Testing and code review is the bottleneck for development; we get more
-pull requests than we can review and test. Please be patient and help
-out, and remember this is a security-critical project where any
-mistake might cost people lots of money.
+Developers are strongly encouraged to write unit tests for new code, and to
+submit new unit tests for old code.
-Automated Testing
------------------
+Unit tests for the core code are in `src/test/`. To compile and run them:
-Developers are strongly encouraged to write unit tests for new code,
-and to submit new unit tests for old code.
+ cd src; make -f makefile.linux test
-Unit tests for the core code are in src/test/
-To compile and run them:
- cd src; make -f makefile.linux test
+Unit tests for the GUI code are in `src/qt/test/`. To compile and run them:
-Unit tests for the GUI code are in src/qt/test/
-To compile and run them:
- qmake BITCOIN_QT_TEST=1 -o Makefile.test bitcoin-qt.pro
- make -f Makefile.test
- ./Bitcoin-Qt
+ qmake BITCOIN_QT_TEST=1 -o Makefile.test bitcoin-qt.pro
+ make -f Makefile.test
+ ./Bitcoin-Qt
-Every pull request is built for both Windows and
-Linux on a dedicated server, and unit and sanity
-tests are automatically run. The binaries
-produced may be used for manual QA testing
-(a link to them will appear in a comment on the pull request
-from 'BitcoinPullTester').
-See https://github.com/TheBlueMatt/test-scripts for the
-build/test scripts.
+Every pull request is built for both Windows and Linux on a dedicated server,
+and unit and sanity tests are automatically run. The binaries produced may be
+used for manual QA testing -- a link to them will appear in a comment on the
+pull request posted by 'BitcoinPullTester'. See `https://github.com/TheBlueMatt/test-scripts`
+for the build/test scripts.
-Manual Quality Assurance (QA) Testing
--------------------------------------
+### Manual Quality Assurance (QA) Testing
-Large changes should have a test plan, and should be tested
-by somebody other than the developer who wrote the code.
+Large changes should have a test plan, and should be tested by somebody other
+than the developer who wrote the code.
-See https://github.com/bitcoin/QA/ for how to create a test plan.
+See `https://github.com/bitcoin/QA/` for how to create a test plan.
diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro
index c7e73d2dd3..7bab4a4975 100644
--- a/bitcoin-qt.pro
+++ b/bitcoin-qt.pro
@@ -372,6 +372,8 @@ win32:!contains(MINGW_THREAD_BUGFIX, 0) {
!win32:!macx {
DEFINES += LINUX
LIBS += -lrt
+ # _FILE_OFFSET_BITS=64 lets 32-bit fopen transparently support large files.
+ DEFINES += _FILE_OFFSET_BITS=64
}
macx:HEADERS += src/qt/macdockiconhandler.h
diff --git a/contrib/macdeploy/notes.txt b/contrib/macdeploy/notes.txt
index a3f0b5447d..3d74901437 100644
--- a/contrib/macdeploy/notes.txt
+++ b/contrib/macdeploy/notes.txt
@@ -5,7 +5,7 @@ Python 2.7 and make it your default Python installation.
You will need the appscript package for the fancy disk image creation to work.
Install it by invoking "sudo easy_install appscript".
-Ths script should be invoked in the target directory like this:
+This script should be invoked in the target directory like this:
$source_dir/contrib/macdeploy/macdeployqtplus Bitcoin-Qt.app -add-qt-tr da,de,es,hu,ru,uk,zh_CN,zh_TW -dmg -fancy $source_dir/contrib/macdeploy/fancy.plist -verbose 2
During the process, the disk image window will pop up briefly where the fancy
diff --git a/contrib/verifysfbinaries/verify.sh b/contrib/verifysfbinaries/verify.sh
index 0e71650c6f..02814d894b 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/test/SHA256SUMS.asc"
+SIGNATUREFILE="http://downloads.sourceforge.net/project/bitcoin/Bitcoin/bitcoin-0.8.0/SHA256SUMS.asc"
SIGNATUREFILENAME="SHA256SUMS.asc"
RCSUBDIR="test/"
@@ -81,7 +81,7 @@ if [ $RET -ne 0 ]; then
#and notify the user if it's bad
echo "Bad signature."
elif [ $RET -eq 2 ]; then
- #or if a gpg error has occured
+ #or if a gpg error has occurred
echo "gpg error. Do you have Gavin's code signing key installed?"
fi
diff --git a/doc/files.txt b/doc/files.txt
new file mode 100644
index 0000000000..5d4cdabf8d
--- /dev/null
+++ b/doc/files.txt
@@ -0,0 +1,19 @@
+Used in 0.8.0:
+* wallet.dat: personal wallet (BDB) with keys and transactions
+* peers.dat: peer IP address database (custom format); since 0.7.0
+* blocks/blk000??.dat: block data (custom, 128 MiB per file); since 0.8.0
+* blocks/rev000??.dat; block undo data (custom); since 0.8.0 (format changed since pre-0.8)
+* blocks/index/*; block index (LevelDB); since 0.8.0
+* chainstate/*; block chain state database (LevelDB); since 0.8.0
+* database/*: BDB database environment; only used for wallet since 0.8.0
+
+Only used in pre-0.8.0:
+* blktree/*; block chain index (LevelDB); since pre-0.8, replaced by blocks/index/* in 0.8.0
+* coins/*; unspent transaction output database (LevelDB); since pre-0.8, replaced by chainstate/* in 0.8.0
+
+Only used before 0.8.0:
+* blkindex.dat: block chain index database (BDB); replaced by {chainstate/*,blocks/index/*,blocks/rev000??.dat} in 0.8.0
+* blk000?.dat: block data (custom, 2 GiB per file); replaced by blocks/blk000??.dat in 0.8.0
+
+Only used before 0.7.0:
+* addr.dat: peer IP address database (BDB); replaced by peers.dat in 0.7.0
diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp
index 4d2096ef07..e2c420edd7 100644
--- a/src/checkpoints.cpp
+++ b/src/checkpoints.cpp
@@ -31,6 +31,7 @@ namespace Checkpoints
(168000, uint256("0x000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763"))
(193000, uint256("0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317"))
(210000, uint256("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e"))
+ (216116, uint256("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e"))
;
static MapCheckpoints mapCheckpointsTestnet =
diff --git a/src/init.cpp b/src/init.cpp
index 2f37dad56c..15a46946fa 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -365,6 +365,8 @@ void ThreadImport(void *data) {
pblocktree->WriteReindexing(false);
fReindex = false;
printf("Reindexing finished\n");
+ // To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked):
+ InitBlockIndex();
}
}
@@ -802,6 +804,10 @@ bool AppInit2()
if (!LoadBlockIndex())
return InitError(_("Error loading block database"));
+ // Initialize the block index (no-op if non-empty database was already loaded)
+ if (!InitBlockIndex())
+ return InitError(_("Error initializing block database"));
+
uiInterface.InitMessage(_("Verifying block database integrity..."));
if (!VerifyDB())
diff --git a/src/main.cpp b/src/main.cpp
index 847b1ea8a6..8c115c26f9 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -362,6 +362,14 @@ bool CTransaction::IsStandard() const
if (!IsFinal())
return false;
+ // Extremely large transactions with lots of inputs can cost the network
+ // almost as much to process as they cost the sender in fees, because
+ // computing signature hashes is O(ninputs*txsize). Limiting transactions
+ // to MAX_STANDARD_TX_SIZE mitigates CPU exhaustion attacks.
+ unsigned int sz = this->GetSerializeSize(SER_NETWORK, CTransaction::CURRENT_VERSION);
+ if (sz >= MAX_STANDARD_TX_SIZE)
+ return false;
+
BOOST_FOREACH(const CTxIn& txin, vin)
{
// Biggest 'standard' txin is a 3-signature 3-of-3 CHECKMULTISIG
@@ -1250,7 +1258,6 @@ bool ConnectBestBlock(CValidationState &state) {
BOOST_FOREACH(CBlockIndex *pindexSwitch, vAttach) {
if (fRequestShutdown)
break;
- CValidationState state;
try {
if (!SetBestChain(state, pindexSwitch))
return false;
@@ -1405,7 +1412,7 @@ bool CTransaction::CheckInputs(CValidationState &state, CCoinsViewCache &inputs,
}
if (nValueIn < GetValueOut())
- return state.DoS(100, error("ChecktInputs() : %s value in < value out", GetHash().ToString().substr(0,10).c_str()));
+ return state.DoS(100, error("CheckInputs() : %s value in < value out", GetHash().ToString().substr(0,10).c_str()));
// Tally transaction fees
int64 nTxFee = nValueIn - GetValueOut();
@@ -1598,7 +1605,7 @@ bool CBlock::ConnectBlock(CValidationState &state, CBlockIndex* pindex, CCoinsVi
for (unsigned int i=0; i<vtx.size(); i++) {
uint256 hash = GetTxHash(i);
if (view.HaveCoins(hash) && !view.GetCoins(hash).IsPruned())
- return error("ConnectBlock() : tried to overwrite transaction");
+ return state.DoS(100, error("ConnectBlock() : tried to overwrite transaction"));
}
}
@@ -2259,7 +2266,9 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl
++mi)
{
CBlock* pblockOrphan = (*mi).second;
- if (pblockOrphan->AcceptBlock(state))
+ // Use a dummy CValidationState so someone can't setup nodes to counter-DoS based on orphan resolution (that is, feeding people an invalid block based on LegitBlockX in order to get anyone relaying LegitBlockX banned)
+ CValidationState stateDummy;
+ if (pblockOrphan->AcceptBlock(stateDummy))
vWorkQueue.push_back(pblockOrphan->GetHash());
mapOrphanBlocks.erase(pblockOrphan->GetHash());
delete pblockOrphan;
@@ -2661,18 +2670,22 @@ bool LoadBlockIndex()
if (!fReindex && !LoadBlockIndexDB())
return false;
- //
- // Init with genesis block
- //
- if (mapBlockIndex.empty())
- {
- fTxIndex = GetBoolArg("-txindex", false);
- pblocktree->WriteFlag("txindex", fTxIndex);
- printf("Initializing databases...\n");
+ return true;
+}
- if (fReindex)
- return true;
+bool InitBlockIndex() {
+ // Check whether we're already initialized
+ if (pindexGenesisBlock != NULL)
+ return true;
+
+ // Use the provided setting for -txindex in the new database
+ fTxIndex = GetBoolArg("-txindex", false);
+ pblocktree->WriteFlag("txindex", fTxIndex);
+ printf("Initializing databases...\n");
+
+ // Only add the genesis block if not reindexing (in which case we reuse the one already on disk)
+ if (!fReindex) {
// Genesis Block:
// CBlock(hash=000000000019d6, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=4a5e1e, nTime=1231006505, nBits=1d00ffff, nNonce=2083236893, vtx=1)
// CTransaction(hash=4a5e1e, ver=1, vin.size=1, vout.size=1, nLockTime=0)
@@ -2713,15 +2726,19 @@ bool LoadBlockIndex()
assert(hash == hashGenesisBlock);
// Start new block file
- unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION);
- CDiskBlockPos blockPos;
- CValidationState state;
- if (!FindBlockPos(state, blockPos, nBlockSize+8, 0, block.nTime))
- return error("AcceptBlock() : FindBlockPos failed");
- if (!block.WriteToDisk(blockPos))
- return error("LoadBlockIndex() : writing genesis block to disk failed");
- if (!block.AddToBlockIndex(state, blockPos))
- return error("LoadBlockIndex() : genesis block not accepted");
+ try {
+ unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION);
+ CDiskBlockPos blockPos;
+ CValidationState state;
+ if (!FindBlockPos(state, blockPos, nBlockSize+8, 0, block.nTime))
+ return error("AcceptBlock() : FindBlockPos failed");
+ if (!block.WriteToDisk(blockPos))
+ return error("LoadBlockIndex() : writing genesis block to disk failed");
+ if (!block.AddToBlockIndex(state, blockPos))
+ return error("LoadBlockIndex() : genesis block not accepted");
+ } catch(std::runtime_error &e) {
+ return error("LoadBlockIndex() : failed to initialize block database: %s", e.what());
+ }
}
return true;
@@ -3453,8 +3470,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
CDataStream(vMsg) >> tx;
CInv inv(MSG_TX, tx.GetHash());
bool fMissingInputs2 = false;
+ // Use a dummy CValidationState so someone can't setup nodes to counter-DoS based on orphan resolution (that is, feeding people an invalid transaction based on LegitTxX in order to get anyone relaying LegitTxX banned)
+ CValidationState stateDummy;
- if (tx.AcceptToMemoryPool(state, true, true, &fMissingInputs2))
+ if (tx.AcceptToMemoryPool(stateDummy, true, true, &fMissingInputs2))
{
printf(" accepted orphan tx %s\n", inv.hash.ToString().substr(0,10).c_str());
RelayTransaction(tx, inv.hash, vMsg);
@@ -3793,7 +3812,12 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
}
// Resend wallet transactions that haven't gotten in a block yet
- ResendWalletTransactions();
+ // Except during reindex, importing and IBD, when old wallet
+ // transactions become unconfirmed and spams other nodes.
+ if (!fReindex && !fImporting && !IsInitialBlockDownload())
+ {
+ ResendWalletTransactions();
+ }
// Address refresh broadcast
static int64 nLastRebroadcast;
diff --git a/src/main.h b/src/main.h
index 23a4d3ba31..d69aef94ea 100644
--- a/src/main.h
+++ b/src/main.h
@@ -28,6 +28,8 @@ struct CBlockIndexWorkComparator;
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 size for transactions we're willing to relay/mine **/
+static const unsigned int MAX_STANDARD_TX_SIZE = MAX_BLOCK_SIZE_GEN/5;
/** 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 */
@@ -133,6 +135,8 @@ FILE* OpenBlockFile(const CDiskBlockPos &pos, bool fReadOnly = false);
FILE* OpenUndoFile(const CDiskBlockPos &pos, bool fReadOnly = false);
/** Import blocks from an external file */
bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp = NULL);
+/** Initialize a new block tree database + block data on disk */
+bool InitBlockIndex();
/** Load the block tree and coins database from disk */
bool LoadBlockIndex();
/** Verify consistency of the block and coin databases */
diff --git a/src/makefile.unix b/src/makefile.unix
index 14cf1b8fa5..b52a0f8aea 100644
--- a/src/makefile.unix
+++ b/src/makefile.unix
@@ -7,7 +7,7 @@ USE_IPV6:=1
LINK:=$(CXX)
-DEFS=-DBOOST_SPIRIT_THREADSAFE
+DEFS=-DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64
DEFS += $(addprefix -I,$(CURDIR) $(CURDIR)/obj $(BOOST_INCLUDE_PATH) $(BDB_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH))
LIBS = $(addprefix -L,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH))
diff --git a/src/net.cpp b/src/net.cpp
index a6017b7356..3406a28b0e 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1145,11 +1145,17 @@ void MapPort()
// Each pair gives a source name and a seed name.
// The first name is used as information source for addrman.
// The second name should resolve to a list of seed addresses.
-static const char *strDNSSeed[][2] = {
+static const char *strMainNetDNSSeed[][2] = {
{"bitcoin.sipa.be", "seed.bitcoin.sipa.be"},
{"bluematt.me", "dnsseed.bluematt.me"},
{"dashjr.org", "dnsseed.bitcoin.dashjr.org"},
{"xf2.org", "bitseed.xf2.org"},
+ {NULL, NULL}
+};
+
+static const char *strTestNetDNSSeed[][2] = {
+ {"bitcoin.petertodd.org", "testnet-seed.bitcoin.petertodd.org"},
+ {NULL, NULL}
};
void ThreadDNSAddressSeed(void* parg)
@@ -1175,32 +1181,31 @@ void ThreadDNSAddressSeed(void* parg)
void ThreadDNSAddressSeed2(void* parg)
{
+ static const char *(*strDNSSeed)[2] = fTestNet ? strTestNetDNSSeed : strMainNetDNSSeed;
+
printf("ThreadDNSAddressSeed started\n");
int found = 0;
- if (!fTestNet)
- {
- printf("Loading addresses from DNS seeds (could take a while)\n");
-
- for (unsigned int seed_idx = 0; seed_idx < ARRAYLEN(strDNSSeed); seed_idx++) {
- if (HaveNameProxy()) {
- AddOneShot(strDNSSeed[seed_idx][1]);
- } else {
- vector<CNetAddr> vaddr;
- vector<CAddress> vAdd;
- if (LookupHost(strDNSSeed[seed_idx][1], vaddr))
+ printf("Loading addresses from DNS seeds (could take a while)\n");
+
+ for (unsigned int seed_idx = 0; strDNSSeed[seed_idx][0] != NULL; seed_idx++) {
+ if (HaveNameProxy()) {
+ AddOneShot(strDNSSeed[seed_idx][1]);
+ } else {
+ vector<CNetAddr> vaddr;
+ vector<CAddress> vAdd;
+ if (LookupHost(strDNSSeed[seed_idx][1], vaddr))
+ {
+ BOOST_FOREACH(CNetAddr& ip, vaddr)
{
- BOOST_FOREACH(CNetAddr& ip, vaddr)
- {
- int nOneDay = 24*3600;
- CAddress addr = CAddress(CService(ip, GetDefaultPort()));
- addr.nTime = GetTime() - 3*nOneDay - GetRand(4*nOneDay); // use a random age between 3 and 7 days old
- vAdd.push_back(addr);
- found++;
- }
+ int nOneDay = 24*3600;
+ CAddress addr = CAddress(CService(ip, GetDefaultPort()));
+ addr.nTime = GetTime() - 3*nOneDay - GetRand(4*nOneDay); // use a random age between 3 and 7 days old
+ vAdd.push_back(addr);
+ found++;
}
- addrman.Add(vAdd, CNetAddr(strDNSSeed[seed_idx][0], true));
}
+ addrman.Add(vAdd, CNetAddr(strDNSSeed[seed_idx][0], true));
}
}
diff --git a/src/qt/aboutdialog.cpp b/src/qt/aboutdialog.cpp
index 0b98befe8d..755413b2bb 100644
--- a/src/qt/aboutdialog.cpp
+++ b/src/qt/aboutdialog.cpp
@@ -1,14 +1,20 @@
#include "aboutdialog.h"
#include "ui_aboutdialog.h"
+
#include "clientmodel.h"
-#include "version.h"
+// Copyright year (2009-this)
+// Todo: update this when changing our copyright comments in the source
+const int ABOUTDIALOG_COPYRIGHT_YEAR = 2013;
AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AboutDialog)
{
ui->setupUi(this);
+
+ // Set current copyright year
+ ui->copyrightLabel->setText(tr("Copyright") + QString(" &copy; ") + tr("2009-%1 The Bitcoin developers").arg(ABOUTDIALOG_COPYRIGHT_YEAR));
}
void AboutDialog::setModel(ClientModel *model)
diff --git a/src/qt/aboutdialog.h b/src/qt/aboutdialog.h
index 2ed9e9e7c4..33b1437674 100644
--- a/src/qt/aboutdialog.h
+++ b/src/qt/aboutdialog.h
@@ -18,6 +18,7 @@ public:
~AboutDialog();
void setModel(ClientModel *model);
+
private:
Ui::AboutDialog *ui;
diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp
index 92a511adb9..5bd1517091 100644
--- a/src/qt/bitcoinstrings.cpp
+++ b/src/qt/bitcoinstrings.cpp
@@ -109,13 +109,24 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low!"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Transaction creation failed!"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Wallet locked, unable to create transaction!"),
QT_TRANSLATE_NOOP("bitcoin-core", "Error: could not start node"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Error: system error: "),
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to listen on any port. Use -listen=0 if you want this."),
+QT_TRANSLATE_NOOP("bitcoin-core", "Failed to read block info"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Failed to read block"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Failed to sync block index"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write block index"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write block info"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write block"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write file info"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write to coin database"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write transaction index"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write undo data"),
QT_TRANSLATE_NOOP("bitcoin-core", "Fee per KB to add to transactions you send"),
QT_TRANSLATE_NOOP("bitcoin-core", "Find peers using DNS lookup (default: 1 unless -connect)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Find peers using internet relay chat (default: 0)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Generate coins"),
QT_TRANSLATE_NOOP("bitcoin-core", "Get help for a command"),
-QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: 2500, 0 = all)"),
+QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: 288, 0 = all)"),
QT_TRANSLATE_NOOP("bitcoin-core", "How thorough the block verification is (0-4, default: 3)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Importing blocks from block database..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Imports blocks from external blk000??.dat file"),
@@ -163,6 +174,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Specify connection timeout in milliseconds (d
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 your own public address"),
+QT_TRANSLATE_NOOP("bitcoin-core", "System error: "),
QT_TRANSLATE_NOOP("bitcoin-core", "This help message"),
QT_TRANSLATE_NOOP("bitcoin-core", "Threshold for disconnecting misbehaving peers (default: 100)"),
QT_TRANSLATE_NOOP("bitcoin-core", "To use the %s option"),
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index 12bd989338..084ad12a56 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -48,7 +48,10 @@ int ClientModel::getNumBlocksAtStartup()
QDateTime ClientModel::getLastBlockDate() const
{
- return QDateTime::fromTime_t(pindexBest->GetBlockTime());
+ if (pindexBest)
+ return QDateTime::fromTime_t(pindexBest->GetBlockTime());
+ else
+ return QDateTime::fromTime_t(1231006505); // Genesis block's time
}
void ClientModel::updateTimer()
diff --git a/src/qt/forms/aboutdialog.ui b/src/qt/forms/aboutdialog.ui
index b59c2445de..80768f89b0 100644
--- a/src/qt/forms/aboutdialog.ui
+++ b/src/qt/forms/aboutdialog.ui
@@ -91,7 +91,10 @@
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
- <string>Copyright © 2009-2012 The Bitcoin developers</string>
+ <string notr="true">Copyright &amp;copy; 2009-YYYY The Bitcoin developers</string>
+ </property>
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts
index 4895e9ba4e..18249b1669 100644
--- a/src/qt/locale/bitcoin_en.ts
+++ b/src/qt/locale/bitcoin_en.ts
@@ -15,12 +15,7 @@
<translation>&lt;b&gt;Bitcoin&lt;/b&gt; version</translation>
</message>
<message>
- <location line="+41"/>
- <source>Copyright © 2009-2012 The Bitcoin developers</source>
- <translation>Copyright © 2009-2012 The Bitcoin developers</translation>
- </message>
- <message>
- <location line="+13"/>
+ <location line="+57"/>
<source>
This is experimental software.
@@ -34,6 +29,16 @@ Distributed under the MIT/X11 software license, see the accompanying file COPYIN
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</translation>
</message>
+ <message>
+ <location filename="../aboutdialog.cpp" line="+17"/>
+ <source>Copyright</source>
+ <translation>Copyright</translation>
+ </message>
+ <message>
+ <location line="+0"/>
+ <source>2009-%1 The Bitcoin developers</source>
+ <translation>2009-%1 The Bitcoin developers</translation>
+ </message>
</context>
<context>
<name>AddressBookPage</name>
@@ -713,7 +718,7 @@ Address: %4
<context>
<name>ClientModel</name>
<message>
- <location filename="../clientmodel.cpp" line="+86"/>
+ <location filename="../clientmodel.cpp" line="+89"/>
<source>Network Alert</source>
<translation>Network Alert</translation>
</message>
@@ -2174,12 +2179,12 @@ Address: %4
<translation>Bitcoin version</translation>
</message>
<message>
- <location line="+83"/>
+ <location line="+95"/>
<source>Usage:</source>
<translation>Usage:</translation>
</message>
<message>
- <location line="-23"/>
+ <location line="-24"/>
<source>Send command to -server or bitcoind</source>
<translation>Send command to -server or bitcoind</translation>
</message>
@@ -2214,12 +2219,12 @@ Address: %4
<translation>Generate coins</translation>
</message>
<message>
- <location line="-15"/>
+ <location line="-26"/>
<source>Don&apos;t generate coins</source>
<translation>Don&apos;t generate coins</translation>
</message>
<message>
- <location line="+62"/>
+ <location line="+73"/>
<source>Specify data directory</source>
<translation>Specify data directory</translation>
</message>
@@ -2239,22 +2244,22 @@ Address: %4
<translation>Maintain at most &lt;n&gt; connections to peers (default: 125)</translation>
</message>
<message>
- <location line="-35"/>
+ <location line="-46"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Connect to a node to retrieve peer addresses, and disconnect</translation>
</message>
<message>
- <location line="+66"/>
+ <location line="+77"/>
<source>Specify your own public address</source>
<translation>Specify your own public address</translation>
</message>
<message>
- <location line="+2"/>
+ <location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Threshold for disconnecting misbehaving peers (default: 100)</translation>
</message>
<message>
- <location line="-117"/>
+ <location line="-129"/>
<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>
@@ -2274,17 +2279,17 @@ Address: %4
<translation>Accept command line and JSON-RPC commands</translation>
</message>
<message>
- <location line="+63"/>
+ <location line="+74"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Run in the background as a daemon and accept commands</translation>
</message>
<message>
- <location line="+31"/>
+ <location line="+32"/>
<source>Use the test network</source>
<translation>Use the test network</translation>
</message>
<message>
- <location line="-93"/>
+ <location line="-105"/>
<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>
@@ -2425,16 +2430,76 @@ If the file does not exist, create it with owner-readable-only file permissions.
</message>
<message>
<location line="+2"/>
+ <source>Error: system error: </source>
+ <translation>Error: system error: </translation>
+ </message>
+ <message>
+ <location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>Failed to listen on any port. Use -listen=0 if you want this.</translation>
</message>
<message>
+ <location line="+1"/>
+ <source>Failed to read block info</source>
+ <translation>Failed to read block info</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Failed to read block</source>
+ <translation>Failed to read block</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Failed to sync block index</source>
+ <translation>Failed to sync block index</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Failed to write block index</source>
+ <translation>Failed to write block index</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Failed to write block info</source>
+ <translation>Failed to write block info</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Failed to write block</source>
+ <translation>Failed to write block</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Failed to write file info</source>
+ <translation>Failed to write file info</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Failed to write to coin database</source>
+ <translation>Failed to write to coin database</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Failed to write transaction index</source>
+ <translation>Failed to write transaction index</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Failed to write undo data</source>
+ <translation>Failed to write undo data</translation>
+ </message>
+ <message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation>Find peers using DNS lookup (default: 1 unless -connect)</translation>
</message>
<message>
- <location line="+5"/>
+ <location line="+4"/>
+ <source>How many blocks to check at startup (default: 288, 0 = all)</source>
+ <translation>How many blocks to check at startup (default: 288, 0 = all)</translation>
+ </message>
+ <message>
+ <location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation>How thorough the block verification is (0-4, default: 3)</translation>
</message>
@@ -2544,7 +2609,12 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>Specify connection timeout in milliseconds (default: 5000)</translation>
</message>
<message>
- <location line="+13"/>
+ <location line="+4"/>
+ <source>System error: </source>
+ <translation>System error: </translation>
+ </message>
+ <message>
+ <location line="+10"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Use UPnP to map the listening port (default: 0)</translation>
</message>
@@ -2584,32 +2654,32 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>wallet.dat corrupt, salvage failed</translation>
</message>
<message>
- <location line="-44"/>
+ <location line="-45"/>
<source>Password for JSON-RPC connections</source>
<translation>Password for JSON-RPC connections</translation>
</message>
<message>
- <location line="-54"/>
+ <location line="-65"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Allow JSON-RPC connections from specified IP address</translation>
</message>
<message>
- <location line="+63"/>
+ <location line="+74"/>
<source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source>
<translation>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</translation>
</message>
<message>
- <location line="-106"/>
+ <location line="-117"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Execute command when the best block changes (%s in cmd is replaced by block hash)</translation>
</message>
<message>
- <location line="+127"/>
+ <location line="+139"/>
<source>Upgrade wallet to latest format</source>
<translation>Upgrade wallet to latest format</translation>
</message>
<message>
- <location line="-15"/>
+ <location line="-16"/>
<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>
@@ -2619,17 +2689,12 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>Rescan the block chain for missing wallet transactions</translation>
</message>
<message>
- <location line="-27"/>
- <source>How many blocks to check at startup (default: 2500, 0 = all)</source>
- <translation>How many blocks to check at startup (default: 2500, 0 = all)</translation>
- </message>
- <message>
- <location line="+56"/>
+ <location line="+30"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Use OpenSSL (https) for JSON-RPC connections</translation>
</message>
<message>
- <location line="-20"/>
+ <location line="-21"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Server certificate file (default: server.cert)</translation>
</message>
@@ -2639,12 +2704,12 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>Server private key (default: server.pem)</translation>
</message>
<message>
- <location line="-136"/>
+ <location line="-147"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
- <location line="+147"/>
+ <location line="+159"/>
<source>This help message</source>
<translation>This help message</translation>
</message>
@@ -2654,7 +2719,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>Unable to bind to %s on this computer (bind returned error %d, %s)</translation>
</message>
<message>
- <location line="-71"/>
+ <location line="-83"/>
<source>Connect through socks proxy</source>
<translation>Connect through socks proxy</translation>
</message>
@@ -2664,12 +2729,12 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>Allow DNS lookups for -addnode, -seednode and -connect</translation>
</message>
<message>
- <location line="+43"/>
+ <location line="+54"/>
<source>Loading addresses...</source>
<translation>Loading addresses...</translation>
</message>
<message>
- <location line="-25"/>
+ <location line="-36"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Error loading wallet.dat: Wallet corrupted</translation>
</message>
@@ -2679,7 +2744,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>Error loading wallet.dat: Wallet requires newer version of Bitcoin</translation>
</message>
<message>
- <location line="+74"/>
+ <location line="+86"/>
<source>Verifying block database integrity...</source>
<translation>Verifying block database integrity...</translation>
</message>
@@ -2694,17 +2759,17 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>Wallet needed to be rewritten: restart Bitcoin to complete</translation>
</message>
<message>
- <location line="-78"/>
+ <location line="-90"/>
<source>Error loading wallet.dat</source>
<translation>Error loading wallet.dat</translation>
</message>
<message>
- <location line="+20"/>
+ <location line="+31"/>
<source>Invalid -proxy address: &apos;%s&apos;</source>
<translation>Invalid -proxy address: &apos;%s&apos;</translation>
</message>
<message>
- <location line="+47"/>
+ <location line="+48"/>
<source>Unknown network specified in -onlynet: &apos;%s&apos;</source>
<translation>Unknown network specified in -onlynet: &apos;%s&apos;</translation>
</message>
@@ -2714,7 +2779,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>Unknown -socks proxy version requested: %i</translation>
</message>
<message>
- <location line="-76"/>
+ <location line="-88"/>
<source>Cannot resolve -bind address: &apos;%s&apos;</source>
<translation>Cannot resolve -bind address: &apos;%s&apos;</translation>
</message>
@@ -2724,17 +2789,17 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>Cannot resolve -externalip address: &apos;%s&apos;</translation>
</message>
<message>
- <location line="+31"/>
+ <location line="+42"/>
<source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source>
<translation>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation>
</message>
<message>
- <location line="-15"/>
+ <location line="-26"/>
<source>Error: could not start node</source>
<translation>Error: could not start node</translation>
</message>
<message>
- <location line="+16"/>
+ <location line="+27"/>
<source>Invalid amount</source>
<translation>Invalid amount</translation>
</message>
@@ -2749,7 +2814,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>Loading block index...</translation>
</message>
<message>
- <location line="-45"/>
+ <location line="-56"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Add a node to connect to and attempt to keep the connection open</translation>
</message>
@@ -2759,7 +2824,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>Unable to bind to %s on this computer. Bitcoin is probably already running.</translation>
</message>
<message>
- <location line="+54"/>
+ <location line="+65"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation>Find peers using internet relay chat (default: 0)</translation>
</message>
@@ -2774,7 +2839,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>Loading wallet...</translation>
</message>
<message>
- <location line="-40"/>
+ <location line="-51"/>
<source>Cannot downgrade wallet</source>
<translation>Cannot downgrade wallet</translation>
</message>
@@ -2789,22 +2854,22 @@ If the file does not exist, create it with owner-readable-only file permissions.
<translation>Cannot write default address</translation>
</message>
<message>
- <location line="+50"/>
+ <location line="+61"/>
<source>Rescanning...</source>
<translation>Rescanning...</translation>
</message>
<message>
- <location line="-44"/>
+ <location line="-55"/>
<source>Done loading</source>
<translation>Done loading</translation>
</message>
<message>
- <location line="+66"/>
+ <location line="+78"/>
<source>To use the %s option</source>
<translation>To use the %s option</translation>
</message>
<message>
- <location line="-61"/>
+ <location line="-73"/>
<source>Error</source>
<translation>Error</translation>
</message>
diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp
index 5224051ace..bbaf40c735 100644
--- a/src/rpcrawtransaction.cpp
+++ b/src/rpcrawtransaction.cpp
@@ -421,7 +421,7 @@ Value signrawtransaction(const Array& params, bool fHelp)
Object prevOut = p.get_obj();
- RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type)("redeemScript",str_type));
+ RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type));
uint256 txid = ParseHashO(prevOut, "txid");
@@ -450,12 +450,16 @@ Value signrawtransaction(const Array& params, bool fHelp)
// if redeemScript given and not using the local wallet (private keys
// given), add redeemScript to the tempKeystore so it can be signed:
- Value v = find_value(prevOut, "redeemScript");
- if (fGivenKeys && scriptPubKey.IsPayToScriptHash() && !(v == Value::null))
+ if (fGivenKeys && scriptPubKey.IsPayToScriptHash())
{
- vector<unsigned char> rsData(ParseHexV(v, "redeemScript"));
- CScript redeemScript(rsData.begin(), rsData.end());
- tempKeystore.AddCScript(redeemScript);
+ RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type)("redeemScript",str_type));
+ Value v = find_value(prevOut, "redeemScript");
+ if (!(v == Value::null))
+ {
+ vector<unsigned char> rsData(ParseHexV(v, "redeemScript"));
+ CScript redeemScript(rsData.begin(), rsData.end());
+ tempKeystore.AddCScript(redeemScript);
+ }
}
}
}
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp
index f75b762f1f..1116507a34 100644
--- a/src/test/test_bitcoin.cpp
+++ b/src/test/test_bitcoin.cpp
@@ -28,7 +28,7 @@ struct TestingSetup {
pblocktree = new CBlockTreeDB(1 << 20, true);
pcoinsdbview = new CCoinsViewDB(1 << 23, true);
pcoinsTip = new CCoinsViewCache(*pcoinsdbview);
- LoadBlockIndex();
+ InitBlockIndex();
bool fFirstRun;
pwalletMain = new CWallet("wallet.dat");
pwalletMain->LoadWallet(fFirstRun);
diff --git a/src/wallet.cpp b/src/wallet.cpp
index b8ef2a20bf..2317ac31ac 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -1208,7 +1208,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW
// Limit size
unsigned int nBytes = ::GetSerializeSize(*(CTransaction*)&wtxNew, SER_NETWORK, PROTOCOL_VERSION);
- if (nBytes >= MAX_BLOCK_SIZE_GEN/5)
+ if (nBytes >= MAX_STANDARD_TX_SIZE)
return false;
dPriority /= nBytes;