Commit graph

2504 commits

Author SHA1 Message Date
Gavin Andresen 802a3dfdcc Merge pull request #2160 from petertodd/add-adjustedtime-to-rpc-getinfo
Add adjustedtime to getinfo RPC call
2013-02-22 08:47:45 -08:00
Gavin Andresen 49e332f6fc Merge pull request #1974 from kjj2/walletnotify
Add -walletnotify to call an external script on wallet transactions
2013-02-22 08:47:04 -08:00
Mike Hearn 0556bb22e1 Shorten a startup message. It was getting truncated and looks ugly. 2013-02-20 16:35:30 +01:00
Philip Kaufmann 69e0774714 small changes in init, main, checkpoints.h and bitcoin-qt.pro
- remove an unneeded MODAL flag, as MSG_ERROR sets MODAL
- re-order an if-clause in main to have bool checks before a function call
- fix some log messages that used wrong function names
- make a log message use a correct ellipsis
- remove some unneded spaces, brackets and line-breaks
- fix style for adding files in the Qt project
2013-02-20 08:46:38 +01:00
Luke Dashjr 3a9c2d51e1 Bugfix: makefile.unix: Honour BOOST_LIB_SUFFIX on boost_unit_test_framework 2013-02-19 05:32:39 +00:00
Luke Dashjr 7e2d850b12 Bugfix: makefile.linux-mingw: Fix so passed CXXFLAGS/LDFLAGS work correctly 2013-02-19 05:22:30 +00:00
Gavin Andresen 44d7f4cbeb Set CC/CXX properly for gitian build 2013-02-18 18:38:34 -05:00
Gavin Andresen 1c3924df37 Merge pull request #2311 from gavinandresen/master
Pass compiler flags to leveldb make
2013-02-18 14:31:53 -08:00
Gavin Andresen dbac38170a Merge pull request #2315 from sipa/loaderror
Improve block database load error reporting
2013-02-18 14:31:20 -08:00
Gregory Maxwell 907a2aa4c7 Internal RNG for approximateBestSubset to prevent degenerate behavior.
This fixes test_bitcoin failures on openbsd reported by dhill on IRC.

  On some systems rand() is a simple LCG over 2^31 and so it produces
an even-odd sequence.  ApproximateBestSubset was only using the least
significant bit and so every run of the iterative solver would be the
same for some inputs, resulting in some pretty dumb decisions.

Using something other than the least significant bit would paper over
the issue but who knows what other way a system's rand() might get us
here.  Instead we use an internal RNG with a period of something like
2^60 which is well behaved.  This also makes it possible to make the
selection deterministic for the tests, if we wanted to implement that.
2013-02-18 14:13:39 -08:00
Pieter Wuille f7f3a96b74 Improve block database load error reporting 2013-02-17 23:25:42 +01:00
Gavin Andresen 1d83141803 Merge branch 'loaderror' of git://github.com/sipa/bitcoin 2013-02-16 19:08:57 -05:00
Pieter Wuille 398774181a Improve block database load error reporting 2013-02-16 19:46:00 +01:00
Wladimir J. van der Laan 5258fbe492 Merge pull request #2283 from Diapolo/translations
translations update (bitcoinstrings.cpp + bitcoin_en.ts)
2013-02-16 07:36:50 -08:00
Pieter Wuille 9f2467ad62 Transactions-based verification progress 2013-02-16 14:51:00 +01:00
Wladimir J. van der Laan 24cde0b7d1 Change progress bar from block-based to time-based
This is less confusing to most people, and doesn't rely on estimates
of the total number of blocks received from other nodes.
2013-02-16 14:51:00 +01:00
Gavin Andresen fbd860287e Pass compiler flags down into leveldb make
Fixes issue#2288. Includes cleanups from Luke's pull 2243.
2013-02-15 19:55:44 -05:00
Andrew Poelstra 3913a99087 Enable dumpprivkey in safe mode 2013-02-14 11:55:55 -08:00
Gavin Andresen 8269a0953e Reimplement click-to-pay links. Add OSX support.
Switch to using Qt's QLocalServer/QLocalSocket to handle bitcoin
payment links (bitcoin:... URIs)

Reason for switch: the boost::interprocess mechanism seemed flaky,
and doesn't mesh as well with "The Qt Way"

qtipcserver.cpp/h is replaced by paymentserver.cpp/h

Click-to-pay now also works on OSX, with a custom Info.plist
that registers Bitcoin-Qt as a handler for bitcoin: URLs and
an event listener on the main QApplication that handles
QFileOpenEvents (Qt translates 'url clicked' AppleEvents into
QFileOpenEvents automagically).
2013-02-12 15:41:31 -05:00
Gavin Andresen 2f0fa79db2 Merge pull request #2286 from gavinandresen/fix2285
Do not use C++11 std::vector.data()
2013-02-11 16:01:24 -08:00
Petter Reinholdtsen 17121ec4fe Use QImage.bits instead of QImage.constBits to ease backporting
Image.constBits was introduced in Qt 4.7.  Should be ok here to use
QImage.bits which allows linking against the Qt in Squeeze.
2013-02-09 19:18:53 +01:00
Gavin Andresen ba1d08008e Do not use C++11 std::vector.data()
std::vector.data() is a C++11 feature that makes my OSX build machine unhappy.
2013-02-07 18:54:22 -05:00
Philip Kaufmann f561f3f37f translations update (bitcoinstrings.cpp + bitcoin_en.ts) 2013-02-07 07:39:58 +01:00
Gavin Andresen f50706796b Merge commit 'd38c6488d067c2e88726e2ca99bc76fd67dab49b' 2013-02-06 16:06:43 -05:00
Gavin Andresen 8f66aedfaa Merge pull request #2279 from sipa/cvrbip30
Bugfix CValidationResult for BIP30 + add DoS
2013-02-06 12:58:52 -08:00
Gavin Andresen 817c44a00d Merge pull request #2264 from gmaxwell/signrawtransaction_for_regular_missing_txins
Signrawtransaction shouldn't require redeemScript for non-p2sh txins.
2013-02-06 10:02:28 -08:00
Pieter Wuille 7cdc37c0a4 Bugfix CValidationResult for BIP30 + add DoS 2013-02-06 16:33:51 +01:00
Rubén Darío Ponticelli e90b831e83 Do not call ResendWalletTransactions when reindexing, importing or on IBD
Calling ResendWalletTransactions when reindexing, importing or on IBD spams
other nodes with our old transactions, because they become unconfirmed.
2013-02-05 18:29:41 -03:00
Gavin Andresen 79892883d7 Merge branch 'reindexgen' of git://github.com/sipa/bitcoin 2013-02-05 10:15:06 -05:00
Gavin Andresen 1d0851eca8 Merge pull request #2273 from gavinandresen/txsize
Make transactions larger than 100K non-standard
2013-02-05 07:12:27 -08:00
Gavin Andresen 41e1a0d766 Make transactions larger than 100K non-standard
Extremely large transactions with lots of inputs can cost the network
almost as much to process as they cost the sender in fees.

We would never create transactions larger than 100K big; this change
makes transactions larger than 100K non-standard, so they are not
relayed/mined by default. This is most important for miners that might
create blocks larger than 250K big, who could be vulnerable to a
make-your-blocks-so-expensive-to-verify-they-get-orphaned attack.
2013-02-05 10:08:35 -05:00
Gavin Andresen 0e2e4fdf27 Merge pull request #2253 from luke-jr/bugfix_valstate
Bugfixes for CValidationState
2013-02-04 17:28:20 -08:00
Gavin Andresen d28bd8b7ca Fix getbalance discrepency
Two changes:

Use IsConfirmed() instead of IsFinal(), so 'getbalance "*" 0' uses the same
'is this output spendable' criteria as 'getbalance'. Fixes issue #172.

And a tiny refactor to CWallet::GetBalance() (redundant call to IsFinal -- IsConfirmed
calls IsFinal).
getbalance with no arguments and 'getbalance "*" 0' could return different different results,
2013-02-04 14:04:26 -05:00
Jeff Garzik 353b7f4a9c Merge pull request #2237 from petertodd/testnet-dnsseed
Add DNS seed support for testnet
2013-02-04 06:51:03 -08:00
Gregory Maxwell 21c6d3aead Signrawtransaction shouldn't require redeemScript for non-p2sh txins.
The redeemScript functionality broke plain offline signing, this
change makes it only look for that parameter when signing a p2sh
input.
2013-02-01 22:59:42 -05:00
Pieter Wuille 386037615a Make sure the genesis block is present after reindex 2013-02-01 23:29:59 +01:00
Philip Kaufmann 5711a20883 translations update (bitcoinstrings.cpp and bitcoin_en.ts) 2013-02-01 18:24:17 +01:00
Philip Kaufmann 8823b4ac3b Bitcoin-Qt: better copyright year handling in AboutDialog
- this change allows us to keep the translation without the need to
  re-translate any string, when we update the copyright year
- copyright symbol is changed to HTML to ensure we get no encoding
  issues and it's removed from the translation string so translators don't
  break it by mistake
2013-02-01 08:52:01 +01:00
Luke Dashjr 8c4e43130b Bugfix: Enable ConnectBestBlock to properly report back validation problems, and ensure orphan processing (when their parents are found) cannot be used to counter-DDoS the node providing the parent
Also fix a minor typo
2013-01-31 03:53:21 +00:00
Gavin Andresen 5b989722be Merge pull request #2245 from gavinandresen/check216116
New checkpoint at block 216116 for the 0.8.0 release
2013-01-30 15:26:04 -08:00
Gavin Andresen 8fd65c944f Merge pull request #2236 from sipa/largefiles
Support large files on 32-bit Linux
2013-01-30 15:25:30 -08:00
Gavin Andresen 85b534b23e Prevent Qt crash at startup with an empty data directory 2013-01-30 15:24:37 -05:00
Gavin Andresen d38c6488d0 Bump version numbers for 0.8 release
Version numbers changed from 0.7.99 to 0.8.0
Set CLIENT_VERSION_IS_RELEASE to remove pre-release warning
Updated copyright in COPYING and doc/READMEs to 2013
Updated doc/release-notes.txt
2013-01-30 14:19:09 -05:00
Gavin Andresen ac7b8ea086 Correctly randomize change output position 2013-01-30 13:56:35 -05:00
Gavin Andresen a53465a649 New checkpoint at block 216116 for the 0.8.0 release 2013-01-30 13:13:22 -05:00
Pieter Wuille 3cce597fc9 Support large files on 32-bit Linux 2013-01-30 16:05:47 +01:00
Peter Todd af8998824c Add DNS seed support for testnet 2013-01-29 23:13:17 -05:00
Pieter Wuille 1eb578796c Drop padding in blk* when finalizing file 2013-01-30 04:55:38 +01:00
Gavin Andresen db3b4ade7b Merge pull request #2224 from sipa/valstate
Improve error handling during validation
2013-01-29 19:37:44 -08:00
Pieter Wuille 421218d304 Deal with LevelDB errors 2013-01-30 04:30:02 +01:00
Gavin Andresen 15ebd4865a Fix two clang3.3 warnings 2013-01-29 22:03:49 -05:00
Pieter Wuille 288fdc092a Native versions for AllocateFileRange() 2013-01-30 04:00:25 +01:00
Pieter Wuille 7851033dd6 Improve dealing with abort conditions 2013-01-30 03:56:45 +01:00
Pieter Wuille 18379c8087 Add disk space checks before flushing CCoins cache 2013-01-30 03:56:45 +01:00
Pieter Wuille 86c82bf9d0 Treat coinbase value violation as DoS 2013-01-30 03:56:44 +01:00
Pieter Wuille ef3988ca36 CValidationState framework 2013-01-30 03:56:44 +01:00
Jeff Garzik 2835080e16 Merge pull request #2231 from sipa/cleanups
Two cleanups before 0.8
2013-01-29 18:08:12 -08:00
Gavin Andresen 74fbb151de New seed nodes, from http://bitcoin.sipa.be/seeds.txt 2013-01-29 17:53:02 -05:00
Pieter Wuille 8fdc94cc8f Rename database directories 2013-01-28 21:08:05 +01:00
Pieter Wuille d0809a1925 Remove support for pre-checksum undo files 2013-01-28 21:07:56 +01:00
Gavin Andresen 79bec38cb4 Merge pull request #1549 from TheBlueMatt/addnoderpc
Addnode optimization and addnode access via RPC
2013-01-28 11:09:03 -08:00
Gavin Andresen f73abdc82d Merge pull request #2223 from gavinandresen/nonfinalnonstandard
Treat non-final transactions as non-standard
2013-01-28 07:56:58 -08:00
Matt Corallo f2bd6c28e6 Try more than the first address for a DNS -addnode. 2013-01-27 03:03:04 -05:00
Matt Corallo 67a11bd6c5 Add a getaddednodeinfo RPC. 2013-01-27 03:03:04 -05:00
Matt Corallo 72a348fd9a Add addnode RPC command. 2013-01-27 03:03:04 -05:00
Matt Corallo f339e9e339 Make ThreadOpenAddedConnections2 exit quicker if(GetNameProxy()). 2013-01-27 03:03:04 -05:00
Matt Corallo 74088e862e Use a copy in place of mapMultiArgs["-addnode"].
Also moves the DNS lookup of -addnode nodes into the repeated
loop, allowing -addnode to follow DNS changes.
2013-01-27 03:03:04 -05:00
Gavin Andresen 6f8730752c Treat non-final transactions as non-standard
At least one service that accepted zero-confirmation transactions
was vulnerable because an attacker could send a transaction
with a lock time far in the future, and then have plenty of time in
which to get a double-spend mined (perhaps from a miner who wasn't
on the network when the first transaction was broadcast).

That is a variation on the "Finney attack". We still don't
recommend anybody accept 0-confirmation transactions as final
payment for anything. This change keeps non-final transactions
from appearing in the wallet, and, assuming most of the network
accepts this change, will prevent them from being relayed until
they are final.
2013-01-26 14:38:40 -05:00
Gavin Andresen 434fa60d75 Merge pull request #2182 from gavinandresen/addressoracle
Remove IsFromMe() check in CTxMemPool::accept()
2013-01-26 11:27:48 -08:00
Pieter Wuille 56869fc07c Check only 288 blocks at startup by default 2013-01-26 18:57:07 +01:00
Pieter Wuille f369d02c51 Various performance tweaks to CCoinsView
* Pass txid's to CCoinsView functions by reference instead of by value
* Add a method to swap CCoins, and use it in some places to avoid a
  allocating copy + destruct.
* Optimize CCoinsViewCache::FetchCoins to do only a single search
  through the backing map.
2013-01-26 18:46:12 +01:00
Philip Kaufmann d001476cbc full translations update
- fetch current translations from Transifex
- update bitcoinstrings.cpp and bitcoin_en.ts
2013-01-26 01:40:42 +01:00
Gavin Andresen 63cc7661a5 Merge pull request #2168 from sipa/txindex
Add optional transaction index to databases
2013-01-25 12:55:52 -08:00
Gavin Andresen d3ab598fd5 Merge pull request #2207 from gavinandresen/leveldb19
Leveldb19
2013-01-24 08:26:20 -08:00
Gavin Andresen 9c9f5c1303 Let limitfreerelay=0 reject ALL free transactions 2013-01-23 20:24:10 -05:00
Philip Kaufmann bb0726a8cf Bitcoin-Qt: cleanup / optimise addressbookpage
- don't show QR Code context menu, when USE_QRCODE=1 was not specified
  when compiling the client
- re-work on_showQRCode_clicked() for better readability and remove an
  unneeded duplicate check
- re-work on_signMessage_clicked() and on_verifyMessage_clicked() to match
  foreach in on_showQRCode_clicked(), which seems more robust / cleaner
- re-order context menu stuff to match real context menu layout
- add comments for all private slots in the class
2013-01-23 22:41:28 +01:00
David Grogan 36311b9a19 Fix corruption bug found and analyzed by dhruba@gmail.com
https://groups.google.com/d/msg/leveldb/Kc9JxuIUu5A/9P0N9RL4ar8J
2013-01-23 14:00:29 -05:00
Sanjay Ghemawat f79ddf24a9 added utility to dump leveldb files 2013-01-23 14:00:29 -05:00
Gavin Andresen 09c69c03f7 Merge pull request #2187 from CodeShark/SyncWithWalletsFix
Bugfix - Moved SyncWithWallets out of ProcessMessage and into CTxMemPool::accept()
2013-01-23 09:29:01 -08:00
Gavin Andresen b1024662ea Port leveldb to MinGW32
Several changes to make the native windows leveldb code compile
with mingw32 and run on 32-bit Windows:
* Remove -std=c++0x dependency (modified code to use NULL instead of
  nullptr)
* Link with -lshlwapi
* Only #define snprintf/etc if compiling with Visual Studio
* Do not link against DbgHelp.lib (wrote a CreateDir instead of using
  DbgHelp's MakeSureDirectoryPathExists
* Define WINVER=0x0500 so MinGW32 can use the 64-bit-filesystem Windows
  api calls
* Define __USE_MINGW_ANSI_STDIO=1 to use MinGW's printf (which supports
  %ll)

I also cleaned up makefile.mingw, assuming that dependencies would be in
the standard /usr/local/{include,lib} by default but allowing overriding
with make DEPSDIR=... etc
2013-01-23 10:42:46 -05:00
Pieter Wuille 8aef119f43 Mingw support for Windows LevelDB port 2013-01-23 10:41:44 -05:00
Pieter Wuille 960797a0de Pre-Vista leveldb::port::InitOnce implementation 2013-01-23 10:41:44 -05:00
Pieter Wuille 21f2ae7563 Native Windows LevelDB port
Import native Windows LevelDB port by Hiram Chirino.

Extracted from from https://github.com/chirino/leveldb.git using
git diff dd0d562..aea83b7
2013-01-23 10:41:44 -05:00
Pieter Wuille 00abfccc5d Remove Snappy support 2013-01-23 10:41:44 -05:00
Pieter Wuille 4786302fb9 Replace leveldb/ with vanilla 1.7.0 2013-01-23 10:41:44 -05:00
Gavin Andresen c429f2b062 Merge pull request #2114 from sipa/strictstrict
Make IsCanonicalScript() check the hash type more thoroughly
2013-01-23 07:08:55 -08:00
Gavin Andresen 5a4af8f71f Merge pull request #2167 from Diapolo/Qt_laa_flag
enable GCC large address aware linker flag (Windows only)
2013-01-23 07:00:24 -08:00
Gavin Andresen a337505bd7 Merge pull request #2192 from mikehearn/notfoundmsg
Add a notfound message to getdata.
2013-01-23 06:48:57 -08:00
Gavin Andresen 1a2e45d8d5 Merge pull request #2188 from TheBlueMatt/bloom
Send transactions after a CMerkleBlock when asked for it in an inv.
2013-01-23 06:48:17 -08:00
Gregory Maxwell d40c164369 Merge pull request #1872 from gmaxwell/listaddrnotmine
In listaddressgroupings push down the IsMine check to run on each input.
2013-01-21 16:30:34 -08:00
Gavin Andresen ea0a2b18f2 Merge pull request #2193 from Diapolo/Qt_parseBitcoinURI
Bitcoin-Qt: extend parseBitcoinURI() pre-check
2013-01-21 13:58:31 -08:00
Gavin Andresen 5fca58cb8e Merge pull request #2190 from sipa/fixgenesis
Bugfix + simplify special case for genesis
2013-01-21 10:07:46 -08:00
Philip Kaufmann 446cbf5fe9 Bitcoin-Qt: extend parseBitcoinURI() pre-check
- add check to verify if an URI is valid
2013-01-21 07:48:54 +01:00
Philip Kaufmann 6e65420bd5 make bitcoinrpc.cpp UTF-8 conformant again
- just replaces a character in a comment, which I had problems with when
  opening the file in Qt Creator IDE
2013-01-20 18:50:30 +01:00
Mike Hearn 903d146030 Add a notfound message to getdata that is sent if any transactions that aren't in the relayable set are requested. 2013-01-19 18:48:26 +01:00
Wladimir J. van der Laan bd85cf3df7 Merge pull request #2157 from Diapolo/Qt_addrlist
Bitcoin-Qt: fix known addressbook bugs
2013-01-19 06:32:40 -08:00
Wladimir J. van der Laan 0c16cc73ef Merge pull request #2171 from Diapolo/init
add InitMessage() to noui and use debug.log for GUI
2013-01-19 06:29:34 -08:00
Pieter Wuille 8301ff5077 Bugfix + simplify special case for genesis 2013-01-19 00:35:17 +01:00
Matt Corallo 192cc910ec Replace 520 constant with MAX_SCRIPT_ELEMENT_SIZE 2013-01-18 13:55:18 -05:00
Matt Corallo 28b80e6065 Send transactions after a CMerkleBlock when asked for it in an inv.
This actually simplifies some SPV code, as they can keep track of
a filtered block and its txn before accepting both in one step.
The previous argument was that SPV nodes should handle the txn the
same as any other free txn and then mark them as connected to a
block when they get the filtered block itself.  However, it now
appears that SPV nodes will need to put in more effort to verify
loose txn than they would to verify txn in blocks, thus making it
more approriate to send the txn after the filtered block.
2013-01-18 12:16:39 -05:00
Eric Lombrozo 35c12d176e Moved SyncWithWallets out of ProcessMessage and into CTxMemPool::accept() so that when adding multiple wallets they will be aware of each other's transactions. 2013-01-18 07:01:05 -08:00
Pieter Wuille 2d1fa42e85 Add optional transaction index to databases
By specifying -txindex when initializing the database, a txid-to-diskpos
index is maintained in the blktree database. This database is used to
help answering getrawtransaction() RPC queries, when enabled.

Changing the -txindex value requires a -reindex; the client will abort
at startup if the database and the specified -txindex mismatch.
2013-01-18 14:39:11 +01:00
Gavin Andresen 2c7847349d Merge pull request #2149 from sipa/fixtxoutrpc
Make output of gettxout RPC more consistent
2013-01-17 18:42:57 -08:00
Gavin Andresen 0e31ae9818 Merge pull request #2060 from sipa/parallel
Parallel script verification
2013-01-17 16:58:58 -08:00
Philip Kaufmann 1f0ce2dd68 enable GCC large address aware linker flag (Windows only)
- this flag allows bitcoin-qt.exe / bitcoind.exe (32-bit application) to
  handle addresses larger than 2GB (up to 3GB on x86 Windows and up to
  4GB on x64 Windows)
2013-01-17 22:01:42 +01:00
Gavin Andresen 91f70a75da Merge pull request #1795 from TheBlueMatt/bloom
Bloom filters
2013-01-17 10:04:08 -08:00
Wladimir J. van der Laan a1f4909e0b Merge pull request #2181 from Diapolo/translations
update bitcoinstrings.cpp and bitcoin_en.ts (2013-01-14)
2013-01-16 12:23:29 -08:00
Matt Corallo c51694eb9b Filter mempool command 2013-01-16 14:34:06 -05:00
Matt Corallo e1a4f3778c Add nFlags to CBloomFilter to make filter updating optional. 2013-01-16 14:34:06 -05:00
Matt Corallo 21aaf255ff Use CPartialMerkleTree for CMerkleBlock transactions. 2013-01-16 14:34:06 -05:00
Pieter Wuille 4bedfa9223 Add CPartialMerkleTree
This adds a compact representation for a subset of a merkle tree's
nodes.
2013-01-16 14:34:06 -05:00
Matt Corallo b1f99bed6f Add a nTweak to bloom filters to tweak the seed. 2013-01-16 12:48:02 -05:00
Matt Corallo 4c8fc1a588 Let a node opt out of tx invs before we get a their bloom filter
Note that the default value for fRelayTxes is false, meaning we
now no longer relay tx inv messages before receiving the remote
peer's version message.
2013-01-16 12:48:02 -05:00
Matt Corallo b02ddbedcb Relay CMerkleBlocks when asked for MSG_FILTERED_BLOCK 2013-01-16 12:48:02 -05:00
Matt Corallo 2878c67cb5 Add test cases for CMerkleBlock and CBloomFilter. 2013-01-16 12:48:02 -05:00
Matt Corallo 9fb106e757 Add a CMerkleBlock to store merkle branches of filtered txes. 2013-01-16 12:48:02 -05:00
Matt Corallo 587f0f855e Add a CBlock.GetBlockHeader 2013-01-16 12:48:02 -05:00
Matt Corallo d3b26f7077 Automatically add any matching outputs to a filter during matching. 2013-01-16 12:48:02 -05:00
Matt Corallo 269d9c6492 Replace RelayMessage with RelayTransaction. 2013-01-16 12:48:02 -05:00
Matt Corallo 422d122537 Add a filter field in CNode, add filterload+filteradd+filterclear 2013-01-16 12:48:02 -05:00
Matt Corallo 133a546074 Bump PROTOCOL_VERSION for filter messages. 2013-01-16 12:48:02 -05:00
Matt Corallo bd21612c37 Add a CBloomFilter class for use as a transaction filter. 2013-01-16 12:48:01 -05:00
Matt Corallo 7ab026f449 Add MurmurHash3 implementation to hash.h/add hash.cpp. 2013-01-16 12:48:01 -05:00
Matt Corallo 68feac96b6 Add const versions of base_uint.end()/begin(), make size() const. 2013-01-16 12:48:01 -05:00
Gavin Andresen 5f04881618 Fix clang warnings 2013-01-15 17:27:29 -05:00
Gavin Andresen ce99358f4a Remove IsFromMe() check in CTxMemPool::accept()
Fixes issue #2178 : attacker could penny-flood with invalid-signature
transactions to deduce which addresses belonged to your node.

I'm committing this early for code review; I still need to write up
a test plan.

Executive summary of fix: check all transactions received from the network
for penny-flood rate-limiting before adding to the memory pool. But do NOT
ratelimit transactions added to the memory pool:
  - because of blockchain reorgs
  - stored in the wallet and added at startup
  - sent from the GUI or one of the send* RPC commands (CWallet::CommitTransaction)

The limit-free-transactions code really should be a method on CNode, with
counters per-peer. But that is a bigger change for another day.
2013-01-15 09:10:22 -05:00
Philip Kaufmann 3a2e07493b update bitcoinstrings.cpp and bitcoin_en.ts (2013-01-14) 2013-01-14 22:52:52 +01:00
Gavin Andresen c83c3cbe97 Merge pull request #2172 from Diapolo/init_messages
make database init messages more valuable
2013-01-14 12:49:42 -08:00
Gavin Andresen e4f2b6b08f Merge pull request #2159 from petertodd/display-nlocktime-correctly
Display tx nLockTime correctly when set to block #
2013-01-14 12:06:07 -08:00
Gavin Andresen 9980d118ee Merge pull request #2129 from gmaxwell/wallet_less_frequent_fees
If the prio. will be enough after the next block don't force fees. [wallet]
2013-01-14 12:05:06 -08:00
Gavin Andresen 1b72229797 Merge pull request #2161 from sipa/noclient
Remove fClient
2013-01-14 11:41:19 -08:00
Gavin Andresen dd46c88f2f Merge pull request #2099 from gavinandresen/blkfile_upgrade
Upgrading to 0.8: re-use blkNNNN.dat files.
2013-01-14 11:37:12 -08:00
Gavin Andresen 40e31fd373 Merge pull request #2142 from gavinandresen/utilprint
OutputDebugStringF code cleanup
2013-01-14 11:36:48 -08:00
Philip Kaufmann 06494cabb4 make database init messages more valuable
- it was bad, that quite some messages were just talking about a database,
  I think a user should know, if we are talking about wallet db or
  block/coin db
- also adds a new init message for "Verifying block database integrity..."
2013-01-13 21:22:40 +01:00
Wladimir J. van der Laan 6213b25cd4 Merge pull request #2166 from Diapolo/Qt_signverify
Bitcoin-Qt: use reference in setAddress_SM() and setAddress_VM()
2013-01-13 10:53:42 -08:00
Philip Kaufmann bb41a87d57 add InitMessage() to noui and use debug.log for GUI
- this pull adds an InitMessage() function to noui.cpp, which outputs init
  messages to debug.log (this allows to remove some printf() calls from
  init.cpp)
- change InitMessage() in bitcoin.cpp to also write init messages to
  debug.log to ensure nothting is missing in the log because of the
  removal of printf() calls in init.cpp
2013-01-11 22:57:22 +01:00
Philip Kaufmann ec95a809af small main.h cleanup (no code changes)
- removes some obsolete comments about CTransaction::FetchInputs(), a
  space and a few new-lines
2013-01-11 17:36:53 +01:00
Gregory Maxwell 1f4b80a437 Merge pull request #2145 from sipa/checkcoins
Coin database checks
2013-01-11 06:27:30 -08:00
Peter Todd 8686f6467c Add timeoffset to getinfo RPC call
Provides a method to get the difference between network adjusted time
and local time from the RPC interface.
2013-01-11 06:11:34 -05:00
Pieter Wuille 45a1ec51b1 Merge pull request #2115 from forrestv/getblocktemplate_allfees
Provide fee data for all txs in RPC getblocktemplate response
2013-01-10 13:09:51 -08:00
Philip Kaufmann 17c1f7f04f Bitcoin-Qt: use reference in setAddress_SM() and setAddress_VM() 2013-01-10 14:04:32 +01:00
Pieter Wuille c2b72ba27f Remove fClient
Client (SPV) mode never got implemented entirely, and whatever part was already
working, is likely not been tested (or even executed at all) for the past two
years. This removes it entirely.

If we want an SPV implementation, I think we should first get the block chain
data structures to be encapsulated in a class implementing a standard interface,
and then writing an alternate implementation with SPV semantics.
2013-01-09 22:28:46 +01:00
Philip Kaufmann e6d2300562 Bitcoin-Qt: fix known addressbook bugs
- add qSort() for cachedAddressTable, as qLowerBound() and qUpperBound()
  require the list to be in ascending order (see
  http://harmattan-dev.nokia.com/docs/library/html/qt4/qtalgorithms.html#qLowerBound)
- add a new check in AddressTableModel::setData() to just return, when no
  changes were made to a label or an address (prevents entry duplication
  issue)
- remove "rec->label = value.toString();" from
  AddressTableModel::setData() as the label gets updated by
  AddressTablePriv::updateEntry() anyway (seems @sipa added this line via
  1025440184 (L6R225))
- add another new check in AddressTableModel::setData() to just return, if
  a duplicate address was found (prevents address overwrite)
- add a new check to EditAddressDialog::setModel() to prevent setting an
  invalid model
- re-work the switch-case statement in AddressTableModel::accept() to
  always break (as return get's called anyway) and order the list to match
  the enum definition
- make accept() in editaddressdialog.h a public slot, which it should be
- misc small coding style changes
2013-01-09 16:55:24 +01:00
Peter Todd 10046e27db Display tx nLockTime correctly when set to block #
Previously when a transaction was set to lock at a specific block the
calculation was reversed, returning a negative number. This broke the UI
and caused it to display %n in place of the actual number.

In addition the previous calculation would display "Open for 0 blocks"
when the block height was such that the next block created would
finalize the transaction. Inserted the word "more" and changed the
calculation so that the last message would be "Open for 1 more block" to
better match user expectations.
2013-01-09 04:18:26 -05:00
Pieter Wuille ef0f422519 Remove contention on signature cache during block validation
Since block validation happens in parallel, multiple threads may be
accessing the signature cache simultaneously. To prevent contention:
* Turn the signature cache lock into a shared mutex
* Make reading from the cache only acquire a shared lock
* Let block validations not store their results in the cache
2013-01-08 02:00:59 +01:00
Pieter Wuille f9cae832e6 Parallelize script verification
* During block verification (when parallelism is requested), script
  check actions are stored instead of being executed immediately.
* After every processed transactions, its signature actions are
  pushed to a CScriptCheckQueue, which maintains a queue and some
  synchronization mechanism.
* Two or more threads (if enabled) start processing elements from
  this queue,
* When the block connection code is finished processing transactions,
  it joins the worker pool until the queue is empty.

As cs_main is held the entire time, and all verification must be
finished before the block continues processing, this does not reach
the best possible performance. It is a less drastic change than
some more advanced mechanisms (like doing verification out-of-band
entirely, and rolling back blocks when a failure is detected).

The -par=N flag controls the number of threads (1-16). 0 means auto,
and is the default.
2013-01-08 02:00:59 +01:00
Pieter Wuille 1d70f4bde8 Remove CheckSig_mode and move logic out of CheckInputs() 2013-01-08 01:49:15 +01:00
Pieter Wuille 2800ce7367 Add CScriptCheck: a closure representing a script check 2013-01-08 01:49:15 +01:00
Pieter Wuille f1136200a6 Move VerifySignature to main 2013-01-08 01:49:14 +01:00
Wladimir J. van der Laan 429915bd0d Merge pull request #2153 from Diapolo/overviewpage
Bitcoin-Qt: fix small stylesheet glitch in overviewpage.ui
2013-01-06 07:26:43 -08:00
Wladimir J. van der Laan 12aacd582a Merge pull request #2151 from Diapolo/signmessage
Bitcoin-Qt: add a Signature label on sign message page
2013-01-06 05:23:01 -08:00
Wladimir J. van der Laan 51b05d0dca Merge pull request #2147 from Diapolo/mq_name_testnet
Bitcoin-Qt: give testnet a unique IPC message queue name
2013-01-06 05:22:34 -08:00
Philip Kaufmann 765e22b82c Bitcoin-Qt: fix small stylesheet glitch in overviewpage.ui 2013-01-06 12:41:49 +01:00
Philip Kaufmann aec056edb5 Bitcoin-Qt: add a Signature label on sign message page 2013-01-06 03:52:33 +01:00
Philip Kaufmann 37f070f564 update noui_ThreadSafeMessageBox function to use strCaption
- ensure we use strCaption for printf and fprintf, as before it could
  happen to have an error message in the debug.log, which had no "Error"
  (or whatever) in front
2013-01-06 03:47:10 +01:00
Philip Kaufmann 8ffbd6c378 Bitcoin-Qt: give testnet a unique IPC message queue name
- this prevents an interference with the IPC message queue (which is used
  for URI processing) when running a testnet and mainnet instance in
  parallel
- to check for testnet, I had to raise the ParseParameters() call in
  main() to the topmost position
2013-01-06 03:42:40 +01:00
Wladimir J. van der Laan 1f4fdb70f0 Merge pull request #2110 from Diapolo/addrbook
Bitcoin-Qt: comment out unused parameter in addressbookpage
2013-01-05 07:56:31 -08:00
Wladimir J. van der Laan eb5c24c464 Merge pull request #2148 from Diapolo/est_block_count
Bitcoin-Qt: never display own block count > estimated block count
2013-01-05 07:45:02 -08:00
Wladimir J. van der Laan 744adb2e61 Merge pull request #1685 from Diapolo/Qt_add_options_reset
Bitcoin-Qt: add a Reset button to the options dialog
2013-01-05 07:36:05 -08:00
Philip Kaufmann 2e43c92428 translations update (bitcoinstrings.cpp + bitcoin_en.ts) 2013-01-05 13:56:24 +01:00
Philip Kaufmann 5fb445b49e Bitcoin-Qt: add a Reset button to the options dialog
- a click on "Reset Options" sets all options to the default values by
  removing all stored settings (QSettings), loading the defaults and
  saving them as the new settings
- before the reset is executed the user is presented a confirmation dialog
- special casing was needed for StartAtStartup
2013-01-05 13:51:36 +01:00
Pieter Wuille 4e68391a7f Make output of gettxout RPC more consistent
* Report "value" in BTC, rather than "amount" in satoshis
* Use ScriptPubKeyToJSON to report script data
2013-01-04 22:51:11 +01:00
Philip Kaufmann 54413aab13 Bitcoin-Qt: never display own block count > estimated block count
- some users reported it as weird, that the estimated block count could be
  lower than our own nodes block number (which is indeed true and not good)
- this pull adds a new default behaviour, which displays our own block
  number as estimated block number, if own >= est. block count
- the pull raises space for nodes block counts in cPeerBlockCounts to 8 to
  be more accurate
- also removes a reduntant setNumBlocks() call in RPCConsole and moves
  initialisation of numBlocksAtStartup in ClientModel, where it belongs
2013-01-04 17:21:40 +01:00
Pieter Wuille 1f355b66cd New database check routine
-checklevel gets a new meaning:
0: verify blocks can be read from disk (like before)
1: verify (contextless) block validity (like before)
2: verify undo files can be read and have good checksums
3: verify coin database is consistent with the last few blocks
   (close to level 6 before)
4: verify all validity rules of the last few blocks

Level 3 is the new default, as it's reasonably fast. As level 3 and
4 are implemented using an in-memory rollback of the database, they
are limited to as many blocks as possible without exceeding the
limits set by -dbcache. The default of -dbcache=25 allows for some
150-200 blocks to be rolled back.

In case an error is found, the application quits with a message
instructing the user to restart with -reindex. Better instructions,
and automatic recovery (when possible) or automatic reindexing are
left as future work.
2013-01-04 14:58:47 +01:00
Forrest Voight f3d872d1ea moved "index_in_template" to a separate variable to clarify what it is 2013-01-03 23:58:40 -05:00
Pieter Wuille 8539361e66 Add checksums to undo data
This should be compatible with older code that didn't write checksums.
2013-01-03 15:29:19 +01:00
Pieter Wuille 2cbd71da06 Make DisconnectBlock fault-tolerant 2013-01-03 15:29:19 +01:00
Jeff Garzik ea9788517b test/util_tests.cpp: one more DateTimeStrFormat 'T' removal 2013-01-01 19:48:28 -05:00
Gavin Andresen ee3374234c OutputDebugStringF code cleanup
Initialize the OutputDebugStringF mutex and file pointer using
boost::call_once, to be thread-safe.
Make the return value of OutputDebugStringF really be the number of
characters written (*printf() semantics).
Declare the fReopenDebugLog flag volatile, since it is changed from
a signal handler.
And don't declare OutputDebugStringF() as inline.
2013-01-01 17:12:30 -05:00
Jeff Garzik 3f964b3c50 Remove 'T' from remaining date/time format strings. 2013-01-01 15:28:28 -05:00
Wladimir J. van der Laan 15ffcc3642 Merge pull request #2032 from burger2/fix_shortcut
Fix duplicate shortcut usage in sign/verify message dialog.
2013-01-01 11:21:58 -08:00
Gavin Andresen 567128a345 Merge pull request #2133 from Diapolo/init_strings
update 2 command-line parameter help messages
2012-12-31 15:06:08 -08:00
Jeff Garzik 393819cde4 Remove 'T' from debug log timestamps
Space separation between major fields is easier for human eyes and
libs to parse.
2012-12-30 20:46:54 -05:00
Philip Kaufmann b8397fbfcd update 2 command-line parameter help messages
- -checkpoints is now much more understandable and should be way easier
  to translate
- -loadblock uses the same format (blk000??.dat) as -reindex
2012-12-28 14:55:38 +01:00
Gregory Maxwell d7836552e6 If the prio. will be enough after the next block don't force fees.
If the user was really after the fastest possible confirmation times
they would be manually setting a fee. In cases where the wallet builds
a transaction with a priority that is too low to qualify as free until
the next block, go ahead without a fee.  Confirmation frequently takes
multiple blocks even when a minimum fee is provided.
2012-12-26 14:16:45 -05:00
Pieter Wuille bffc744444 Make IsCanonicalScript() check the hash type more thoroughly
0 and 128 were previously accepted as standard hash type.

Note that this function is not active in the current verification
code.
2012-12-22 18:39:36 +01:00
Gavin Andresen 23826f1b7f Merge pull request #2116 from sipa/importrescanbool
Convert fRescan argument to importprivkey to bool
2012-12-21 06:30:53 -08:00
Forrest Voight 0f927ceb5b use fee/sigop data in BlockTemplate struct instead of (not always correctly) calculating it ourselves 2012-12-19 16:12:58 -05:00
Forrest Voight 03cac0bb8e changed CreateNewBlock to return a CBlockTemplate object, which includes per-tx fee and sigop count data 2012-12-19 16:12:58 -05:00
Pieter Wuille 5dfbd4ff68 Convert fRescan argument to importprivkey to bool 2012-12-19 12:23:29 +01:00
Pieter Wuille 0fb9073edd Split off hash.h from util.h 2012-12-18 21:39:29 +01:00
fanquake f0bf5fb245 Fix two typos in main.h
Break one long comment down into 3 lines so it's readable.
2012-12-17 18:09:53 +08:00
Gavin Andresen f4445f9982 Upgrading to 0.8: re-use blkNNNN.dat files. 2012-12-16 12:23:59 -05:00
Philip Kaufmann a8fbbd8fb0 Bitcoin-Qt: comment out unused parameter in addressbookpage 2012-12-15 11:15:19 +01:00
Gregory Maxwell a3fad2119b In listaddressgroupings push down the IsMine check to run on each input.
This avoids a potential crash when trying to read the scrippubkeys on
transactions where the first input IsMine but some of the rest are not
when running listaddressgroupings.
2012-12-14 07:35:56 -05:00
Pieter Wuille da8c5c9f4e Merge pull request #2087 from gavinandresen/check210000
Checkpoint at first 25-btc-reward block (210,000)
2012-12-13 14:40:22 -08:00
Pieter Wuille 33766c9557 Merge pull request #2096 from 94m3k1n9/fix-time-formats
Change timestamps to use ISO8601 formatting
2012-12-13 14:39:57 -08:00
Wladimir J. van der Laan 07c3f846c2 Merge pull request #2045 from Diapolo/use_message
use new message() function in BitcoinGUI
2012-12-12 21:17:40 -08:00
Philip Kaufmann 50ce5735d6 LevelDB: build_detect_platform fix NATIVE_WINDOWS indentation
- fix some indentation issues
2012-12-12 19:39:00 +01:00
Gavin Andresen 51dc438942 Merge pull request #2080 from mcassano/importprivkey_rescan_false
add rescan bool to importprivkey to control whether to do a rescan after import
2012-12-12 09:34:24 -08:00
Gavin Andresen 278a09a6c6 Merge pull request #2095 from al42and/upnp
OptionsModel now has MapPortUPnP=false if UPNP is not supported
2012-12-12 09:31:24 -08:00
Gavin Andresen 8a7277a578 Merge pull request #2003 from alexanderkjeldaas/documented-locking-part-2
Documented locking part 1+2
2012-12-12 09:27:35 -08:00
Gavin Andresen d339da70e5 Merge pull request #1825 from roques/bignum2
Bignum2
2012-12-12 09:23:16 -08:00
Gavin Andresen 5bd5d6c45c Merge pull request #1940 from grimd34th/patch-1
Add NATIVE_WINDOWS
2012-12-12 09:20:46 -08:00
Gavin Andresen 095b06cfae Merge pull request #2073 from grimd34th/patch-3
Update src/makefile.mingw
2012-12-12 09:19:26 -08:00
Gavin Andresen a9e055a1ca Merge pull request #2048 from jgarzik/no-checkpoints
Add "checkpoints" option, to permit disabling of checkpoint logic.
2012-12-12 09:18:00 -08:00
Gavin Andresen 78504bb04f Merge pull request #1861 from jgarzik/coinlock
Add new RPC "lockunspent", to prevent spending of selected outputs
2012-12-12 09:15:43 -08:00
Gavin Andresen 043a8fb98d Merge pull request #2059 from sipa/benchmark
Add -benchmark for reporting block processing times
2012-12-12 09:14:52 -08:00
Gavin Andresen dbd5bb8039 Merge pull request #2062 from sipa/nocoins
Reconstruct coins/ database when missing
2012-12-12 09:11:36 -08:00
Gavin Andresen 8b83e2fc2e Merge pull request #2074 from sipa/minor
Two minor inconvenience fixes
2012-12-12 09:10:44 -08:00