Commit graph

3321 commits

Author SHA1 Message Date
Gavin Andresen 4a4e9a3f8d Merge pull request #2610 from gavinandresen/scriptcleanup
Remove implementation of disabled opcodes
2013-05-03 14:38:18 -07:00
Gavin Andresen 61a845dcb6 Merge pull request #2566 from sipa/nodef
Allow the default key to be unavailable
2013-05-03 14:33:02 -07:00
Gavin Andresen aa62b2c433 Merge pull request #2607 from gavinandresen/loadwalletfix
Do not write to wallet during LoadWallet
2013-05-03 14:32:47 -07:00
Pieter Wuille aa6b3061ee Merge pull request #2603 from sipa/nobestblock
Bugfix: if no bestblock record is present, do a -rescan
2013-05-03 14:08:46 -07:00
Gavin Andresen 26585c36b2 Merge pull request #2602 from sipa/utxostate
Improve gettxoutsetinfo command
2013-05-03 11:00:31 -07:00
Pieter Wuille bcb79a64c9 Merge pull request #2598 from Diapolo/init
small init.cpp changes (strings / Winsock init)
2013-05-03 10:44:14 -07:00
Philip Kaufmann 110257a631 small init.cpp changes (strings / Winsock init)
- add a check that requested Winsock version is available
- update some strings
- remove -gen=0 from help-message as this is default
2013-05-03 19:42:12 +02:00
Gavin Andresen 000dc55181 Un-hardcode TX_FEE constants
Allow setting of MIN_TX_FEE / MIN_RELAY_TX_FEE with
-mintxfee / -mintxrelayfee

Default values are the same (0.0001 BTC).
2013-05-03 10:54:31 -04:00
Gavin Andresen 1f00f4e9c9 CreateTransaction: return strFailReason on failure 2013-05-03 10:54:31 -04:00
Gavin Andresen 8de9bb53af Define dust transaction outputs, and make them non-standard 2013-05-03 10:52:09 -04:00
Gavin Andresen b8e1dc2e53 Remove flaky util thread unit tests 2013-05-03 10:45:00 -04:00
Jonas Schnelli 367491df9d osx: show testnet icon in dock as early as possible
A green testnet splashscreen with a normal, orange dock icon looks strange and can confuse users.

Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
2013-05-03 16:14:38 +02:00
Pieter Wuille b45fd0a5a4 Merge pull request #2608 from jonasschnelli/pathCacheFix
clear path cache after getting a proper config file (fixes #2605)
2013-05-03 04:52:03 -07:00
Gavin Andresen bce697d7fa Remove implementation of disabled opcodes
So we stop getting pull requests (like #2604) fixing problems with disabled Script opcodes.
A hard fork would be required to re-enable these, and if we ever did that we'd require extensive review and testing.
2013-05-02 17:33:57 -04:00
Jonas Schnelli b357a71cfa clear path cache after getting a proper config file (fixes #2605)
Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
2013-05-02 18:55:25 +02:00
Gavin Andresen 2f15e86a68 Do not write to wallet during LoadWallet
When debugging another issue, I found a hang-during-startup race condition due to
LoadWallet calling SetMinVersion (via LoadCryptedKey).

Writing to the file that you're in the process of reading is a bad idea.
2013-05-02 12:43:07 -04:00
Gavin Andresen d605bc4cd1 Exit cleanly if AppInit2 returns false
Bitcoin-Qt could core dump if application initialization failed in certain ways.

I double-fixed this:
1) qt/bitcoin.cpp now shuts down core threads cleanly if AppInit2 returns false
2) init.cpp now exits before StartNode() if strErrors is set (no reason to StartNode if we're just going to exit immediately anyway).

Tested by triggering all of the various ways AppInit2 can fail, either by passing bogus command-line arguments or just recompiling tweaked code to simulate failure.

This is a partial fix for #2480
2013-05-02 12:26:33 -04:00
Pieter Wuille a9d9f0f5f7 Do not kill connections on recv buffer overflow
Instead of killing a connection when the receive buffer overflows,
just temporarily halt receiving before that happens. Also, no
matter what, always allow at least one full message in the receive
buffer (otherwise blocks larger than the configured buffer size
would pause indefinitely).
2013-05-01 20:56:50 +02:00
Pieter Wuille 2aceeb01a9 Bugfix: if no bestblock record is present, do a -rescan
It is possible to have a wallet.dat file without any bestblock
record at all (if created offline, for example), which - when
loaded into a client with a up-to-date chain - does no rescan and
shows no transactions.

Also make sure to write the current best block after a rescan, so
it isn't necessary twice.
2013-05-01 19:21:55 +02:00
Pieter Wuille e31aa7c9d7 Improve gettxoutsetinfo command
* Bugfix: output the correct best block hash (during IBD, it can
  differ from the actual current best block)
* Add height to output
* Add hash_serialized, which is a hash of the entire UTXO state.
  Can be useful to compare two nodes.
* Add total_amount, the sum of all UTXOs' values.
2013-05-01 17:21:43 +02:00
Jeff Garzik 9f4976afe2 RPC: strictly require HTTP URI "/"
Previously, JSON-RPC clients accessed URI "/", and the JSON-RPC server
did not care about the URI at all, and would accept any URI as valid.

Change the JSON-RPC server to require URI "/" for all current accesses.

This changes enables the addition of future interfaces at different
URIs, such as pull request #1982 which demonstrates HTTP REST wallet
download.

Or, a future, breaking change in JSON-RPC interface could be introduced
by serving JSON-RPC calls from new URI "/v2/".
2013-05-01 10:41:24 -04:00
Pieter Wuille 788064dd12 Don't announce to non-peer CNodes 2013-04-30 19:41:58 +02:00
Pieter Wuille 1c621e70be Merge pull request #2583 from laanwj/2013_04_netbase_bitfield
netbase: fix !O_NONBLOCK where ~O_NONBLOCK was meant
2013-04-29 16:36:51 -07:00
Pieter Wuille d2cefe1674 Merge pull request #2589 from sipa/win32ldberr
Some win32-leveldb related fixes
2013-04-29 16:36:25 -07:00
Gavin Andresen 67f93dc513 Merge pull request #2568 from sipa/rlimit
Try to increase file descriptor rlimit if necessary
2013-04-29 13:25:13 -07:00
Pieter Wuille 228b29cf8f Merge pull request #2349 from dserrano5/master
Accept negative -par values to leave N CPUs free.
2013-04-29 10:54:04 -07:00
David Serrano ebd7e8bf91 Accept negative -par values to leave N CPUs free. 2013-04-29 19:35:47 +02:00
Wladimir J. van der Laan 7226806e8d Merge pull request #2569 from sipa/win1024fd
Allow select()ing up to 1024 file descriptors on Windows
2013-04-29 10:27:33 -07:00
Pieter Wuille ba29a5590b Try to increase file descriptor rlimit if necessary
As the default can be too low, especially on OSX.
2013-04-29 01:46:24 +02:00
Pieter Wuille 551b367f19 Allow files to be opened for reading multiple times 2013-04-28 14:15:34 +02:00
Wladimir J. van der Laan d23fa49c52 move WSAStartup to init
WSAStartup should be called before using any other socket
functions. BindListenPort is not called if not listening.

Closes #2585.
2013-04-28 08:54:27 +02:00
Pieter Wuille 20d6f2013b Checking whether closing succeeds 2013-04-27 20:07:22 +02:00
Pieter Wuille 67efbda4a2 Print actual Win32 error that occurred on file creation failure. 2013-04-27 18:28:41 +02:00
Tariq Bashir 6e34d9b12a Prevent prevent file descriptor leak in ShrinkDebugFile() 2013-04-27 16:00:28 +02:00
Wladimir J. van der Laan fe9e88cb06 fix !O_NONBLOCK where ~O_NONBLOCK was meant
Using ! on a non-zero value will always return 0.

Also remove some duplicate and superfluous code in other places.
2013-04-27 15:37:26 +02:00
Wladimir J. van der Laan 63888d43be Merge pull request #2530 from jonasschnelli/mac_win_reopen_fix
fixes #1522: GUI Disappearing (Mac OSX)
2013-04-27 02:15:54 -07:00
Wladimir J. van der Laan aa9eee7eaf Merge pull request #2564 from Diapolo/walletview
small updates for walletview.cpp
2013-04-27 02:08:08 -07:00
Wladimir J. van der Laan dffb535ead qt: remove fee recommendation in settings
This value gets stale really quickly, do not hardcode it into a message.
Completely remove it for now.
Later on, a mechanism will be added to determine fees based on the mempool.

Closes #2576
2013-04-27 11:06:43 +02:00
Wladimir J. van der Laan 1a31428ec0 qt: remove extraneous padding introduced in multiwallet support patch
solve issue #2529
2013-04-26 07:38:24 +02:00
Pieter Wuille 33912d1f23 Allow select()ing up to 1024 file descriptors on Windows 2013-04-26 01:31:10 +02:00
Pieter Wuille 360cfe142c Allow the default key to be unavailable
This solves the issue where no default key can be added after -salvagewallet.
2013-04-25 19:36:10 +02:00
Philip Kaufmann 9e334cfae3 translations update 2013-04-25
- new language "se"
- update bitcoin.qrc and bitcoin_en.ts
- fetch current translations from Transifex
2013-04-25 16:53:51 +02:00
Philip Kaufmann 46fd626b21 small updates for walletview.cpp
- make "&Export" translatable
- fix some includes
- small formatting changes
2013-04-25 16:15:31 +02:00
Pieter Wuille ccda03b570 Remove database/ after clean shutdown 2013-04-24 22:38:56 +02:00
Pieter Wuille 1859aafef0 Try moving database/ away in case of failure 2013-04-24 01:37:19 +02:00
Philip Kaufmann e79110822e remove duplicate bitdb.Open() code from init
- remove code from step 7, which we already have in step 5 of init
2013-04-24 00:49:50 +02:00
Pieter Wuille 2233fc5318 Reduce number of open LevelDB files to 64 2013-04-24 00:10:23 +02:00
Wladimir J. van der Laan af10e3f6ac Merge pull request #2526 from Diapolo/Qt_misc
Bitcoin-Qt: misc small changes
2013-04-23 09:27:30 -07:00
Philip Kaufmann 61032f8942 remove obsolete and unused typedef for Windows 2013-04-23 09:54:29 +02:00
Pieter Wuille 97e7901a3a Do not invoke DoS for non-canonical sigs 2013-04-18 22:49:23 +02:00
Wladimir J. van der Laan 72782f3b92 Merge pull request #2525 from laanwj/2013_04_metatypebool
qt: register metatype for bool*
2013-04-18 08:59:49 -07:00
Wladimir J. van der Laan dc2de757a4 Merge pull request #2501 from Diapolo/progress
rework ClientModel::getBlockSource() + BitcoinGUI::setNumBlocks()
2013-04-18 05:54:42 -07:00
Wladimir J. van der Laan 52ae314b5e Merge pull request #2524 from jonasschnelli/new_splashscreen_fresh
new splash screen
2013-04-18 00:05:21 -07:00
Gavin Andresen 8b1d72be32 Merge pull request #2536 from jcalvinowens/makefile-clarifying-comments
Add comments to UNIX Makefile regarding USE_UPNP
2013-04-17 14:21:34 -07:00
Jonas Schnelli e790d47785 new toolbar icon for liunx/win fix #2518
On black toolbars, the new icon doesn't look very well.
Now the toolbar icon has again a transparent "B" for better style on toolbars.
Does not affect the mac client.

Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
2013-04-17 10:51:19 +02:00
Jonas Schnelli f9124587cc new splash screen
why:

- the current splash-screen has no referring to official images on - https://en.bitcoin.it/wiki/Promotional_graphics
- the current splash screen only exists in a low res jpg
- current splash screen looks dark and "hackish"
- new splash screen should generate positive, "trust-emotions".
- new splash screen gives the user infos about the running client.
- new splash screen can handle long messages (in a lot of - languages the text is cropped in current release)

- new size (x2) 400x312

- contains textual information about the client
- textinfos are dynamicly written to the pixmap

when -testnet is switch on, the splashscreen will show the bitcoin logo in testnet-color (as well as a text [testnet])

example: https://dl.dropbox.com/u/7383846/new_bitcoin_splash.png
2013-04-17 01:14:53 -07:00
Calvin Owens e74fbca1c2 Add comments to UNIX Makefile regarding USE_UPNP
The tri-state nature of USE_UPNP isn't immediately obvious, so paste
the explanation from doc/build-unix.txt as a comment in the makefile.
2013-04-17 00:04:03 -05:00
Wladimir J. van der Laan fb53186571 Merge pull request #2519 from jonasschnelli/new_testnet_ico_file
new testnet ico file
2013-04-15 10:35:27 -07:00
Jonas Schnelli 4d17a1b0c2 fix: GUI Disappearing #1522 (Mac OSX)
- this solution works stable on mac and ensures that the window get's reopened when the user clicks the dock icon .
- tested on 10.8 with Qt4.8.4 and Qt5.0.1

Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
2013-04-15 12:02:01 +02:00
Philip Kaufmann a26811ebdf embed bitcoin_testnet.ico in bitcoin-qt.exe (usable for shortcuts) 2013-04-14 21:49:07 +02:00
Philip Kaufmann 41fdc1cad1 overviewpage: make some code Qt5 compatible
- that changes will be fine for Qt4 also
2013-04-14 19:53:27 +02:00
Philip Kaufmann d9d6c7d936 bitcoingui: remove 2 unneeded includes 2013-04-14 19:53:27 +02:00
Philip Kaufmann e9abeac204 bitcoin: use static QApplication:: instead of app. 2013-04-14 19:53:19 +02:00
Philip Kaufmann 99ae01234d aboutdialog: use just "The Bitcoin developers" as tr()-string
- this ensures our new splash screen and this will share a translatable
  string an remove the need for an additional translation
2013-04-14 19:42:15 +02:00
Wladimir J. van der Laan e83a90f127 qt: register metatype for bool*
This allows the bool* type to be passed between threads.  Should solve issue #2402.
2013-04-14 18:50:40 +02:00
Pieter Wuille 20d0810f30 Require strictly-standard encodings in mempool 2013-04-14 00:17:49 +02:00
Wladimir J. van der Laan ac89a1ebe7 Merge pull request #2492 from Diapolo/Qt_message
Bitcoin-Qt: remove " - " on empty title in BitcoinGUI::message()
2013-04-13 05:40:30 -07:00
Wladimir J. van der Laan f81b67829d Merge pull request #2515 from laanwj/2013_04_move_exportbutton
qt: move export button to tabs
2013-04-13 05:39:30 -07:00
Gavin Andresen 1b4b463c01 Merge pull request #2418 from sipa/uintwork
Use a uint256 for bnChainWork
2013-04-12 10:27:56 -07:00
Wladimir J. van der Laan 45155d3010 qt: move export button to tabs
Having the export button at the top was confusing people into thinking
the entire wallet was exported.

This commit moves the export button to the address book, receiving
addresses and transaction tabs separately.
2013-04-12 13:13:32 +02:00
Pieter Wuille 1657c4bc49 Use a uint256 for bnChainWork
Every block index entry currently requires a separately-allocated
CBigNum. By replacing them with uint256, it's just 32 bytes extra
in CBlockIndex itself.

This should save us a few megabytes in RAM, and less allocation
overhead.
2013-04-12 12:17:28 +02:00
Wladimir J. van der Laan 212b42c623 qt: don't show rpcconnect command line option in help
GUI can't connect to RPC. Showing this option in the help confuses
people, so remove it.
2013-04-11 22:29:05 +02:00
Wladimir J. van der Laan 3656a3c558 Merge pull request #2503 from Diapolo/copyright-year
new COPYRIGHT_YEAR macro in clientversion.h
2013-04-11 06:49:46 -07:00
Jonas Schnelli 5ab27b32a2 new testnet window .ico file
Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
2013-04-11 15:17:00 +02:00
Philip Kaufmann 8d643c90a6 Bitcoin-Qt: remove " - " on empty title in BitcoinGUI::message()
- don't display "Bitcoin - " when no title was supplied but just "Bitcoin"
2013-04-11 08:32:55 +02:00
Wladimir J. van der Laan 9a4eaf3cff Merge remote-tracking branch 'jonasschnelli/new_icons' (#2497)
Conflicts:
	doc/assets-attribution.txt
2013-04-11 06:57:27 +02:00
Wladimir J. van der Laan bb8bc860e3 Merge pull request #2487 from Diapolo/translations
translations update 2013-04-08
2013-04-10 13:00:56 -07:00
Philip Kaufmann cdd4400889 use the new COPYRIGHT_YEAR macro in bitcoin-qt.rc
- this reduces the places, where we need to change the year further
2013-04-10 17:15:34 +02:00
Philip Kaufmann ec3cac6631 move COPYRIGHT_YEAR to clientversion.h
- this allows usage of that information also in other places (e.g. splash
  screen)
2013-04-10 16:53:36 +02:00
Philip Kaufmann 4881353efe rework ClientModel::getBlockSource() + BitcoinGUI::setNumBlocks()
- updates ClientModel::getBlockSource() to return all available states and
  sorts enum BlockSource in order of usage cases (none default, then reindex,
  import and network)
- updates BitcoinGUI::setNumBlocks() to better use getBlockSource() and
  also adds a message, when we have NO block source available
2013-04-10 15:53:40 +02:00
Jonas Schnelli 4c23743635 better quality windows .ICO icon file
- icon quality of the win icon of <256px resolutions are now much better

Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
2013-04-10 14:40:51 +02:00
Jonas Schnelli e0af1b3ed6 fix mac specific button modification on addressbookpage
- continue the mac behavior of clearing button icons (because it's unusual on mac apps)
- fix: new button variable names, new buttons (verifyMessage, signMessage)

Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
2013-04-09 21:11:16 +02:00
Jonas Schnelli f9579c55b3 overhaul of the testnet icon (green color) and the toolbar icons
- redefined the green color
- created new toolbar icons
- updated the assets-attribution.txt

Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
2013-04-09 20:05:32 +02:00
Gavin Andresen c553fe8d43 Merge pull request #2469 from Diapolo/clientmodel-progress
Bitcoin-Qt: emit numBlocksChanged for changed reindex or importing state
2013-04-09 10:59:29 -07:00
Gavin Andresen 54c0b3eac7 Merge pull request #2474 from sipa/pre0.8.2
Switch version numbers to 0.8.1.99
2013-04-09 10:57:59 -07:00
Gavin Andresen f158e363a4 Merge pull request #2478 from sipa/fullhash
Always print full hashes (tx, block, inv)
2013-04-09 10:57:16 -07:00
Gavin Andresen 1fd3ed25be Merge pull request #2461 from sipa/syncnode
Make sure we always have a node to do IBD from
2013-04-09 10:51:06 -07:00
Jeff Garzik 1483aac5f9 net.cpp: Do not change primary process name from (default) to "bitcoin-start"
Discussed a bit on IRC.
2013-04-08 22:02:57 -04:00
Gavin Andresen f49992d983 Merge pull request #2243 from luke-jr/bugfix_leveldb
LevelDB build bugfix
2013-04-08 18:03:03 -07:00
Wladimir J. van der Laan fb17911e9a Merge pull request #2470 from Diapolo/progressbarlabel
Bitcoin-Qt: update for BitcoinGUI::eventFilter()
2013-04-08 11:27:02 -07:00
Wladimir J. van der Laan cf03a5ce8a Merge pull request #2481 from laanwj/2013_04_cleanup
qt: remove redundant wallet methods from bitcoingui
2013-04-08 08:25:01 -07:00
Wladimir J. van der Laan 70c71a6a2a Merge pull request #2477 from jonasschnelli/new_icons
new icons for windows, linux, etc.
2013-04-08 08:24:38 -07:00
Pieter Wuille b7b774d82f Merge pull request #2419 from sipa/noreltime
Drop release times for CNode
2013-04-08 08:21:06 -07:00
Gavin Andresen 1829134afe Merge pull request #2272 from gavinandresen/getbalancefix
Fix getbalance discrepency
2013-04-08 06:37:58 -07:00
Pieter Wuille 1828133c62 Merge pull request #2403 from gmaxwell/minfee-to-relayfee
Make MIN_TX_FEE match MIN_RELAY_TX_FEE.
2013-04-08 01:50:21 -07:00
Philip Kaufmann 6a270c5f81 translations update 2013-04-08
- updates for bitcoinstrings.cpp and bitcoin_en.ts
- changes help text for -rpcthreads to match -par
- fix a small glitch with -par to be "-par=<n>"
2013-04-08 08:50:03 +02:00
Gregory Maxwell 96371bc6e0 Merge pull request #2282 from mb300sd/addressinlistunspent
Address in listunspent
2013-04-07 14:44:19 -07:00
Pieter Wuille 86648a8d16 Add bytessent, bytesrecv and syncnode to getpeerinfo 2013-04-07 19:31:13 +02:00
Pieter Wuille 6ed71b5e4f Make sure we always have a node to do IBD from
This introduces the concept of the 'sync node', which is the one we
asked for missing blocks. In case the sync node goes away, a new one
will be selected.

For now, the heuristic is very simple, but it can easily be extended
later to add better policies.
2013-04-07 19:19:13 +02:00
Philip Kaufmann 84b89afbd7 Translations update: pull from Transifex
- added languages in bitcoin.qrc: bs, ca, cy, eo, gu_IN, hi_IN, ja, la,
  lv_LV and th_TH (some translations files were already in src/qt/locale
  but not added in the .qrc file
2013-04-07 13:36:54 +02:00
Wladimir J. van der Laan 7e600cd92d qt: remove redundant wallet methods from bitcoingui
send encryptWallet/backupWallet/changePassphrase directly to walletFrame
2013-04-07 12:11:08 +02:00
Pieter Wuille 1c06aa98c6 Always print full hashes (tx, block, inv) 2013-04-07 03:43:55 +02:00
Jonas Schnelli 27cc0d7fd2 new windows and linux icons
- new windows .ico contains multiple resolutions up to 256px
- new testnet (green) icon
- new png icon for llinux, etc.
- new doxygen icon
- changed the assets-attribution.txt

Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
2013-04-06 20:35:10 +02:00
Jonas Schnelli 5675ae2f11 moved bitcoin.svg to correct folder (qt/res/src)
Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
2013-04-06 20:33:41 +02:00
Philip Kaufmann 87dd6035e5 Bitcoin-Qt: emit numBlocksChanged for changed reindex or importing state
- this allows our progressbarlabel to correctly update, when we
  finish a reindex or import, but do not get new blocks from other sources
2013-04-06 18:50:34 +02:00
Pieter Wuille 2b34779ae2 Switch version numbers to 0.8.1.99 2013-04-06 18:17:14 +02:00
Philip Kaufmann 35ed704d44 Bitcoin-Qt: update for BitcoinGUI::eventFilter()
- this allows us to use the progressbar and the label independently (if
  needed) and still prevents setStatusTip() to use them, if one of the 2
  is active
2013-04-06 12:24:52 +02:00
Pieter Wuille 484af4e2d1 Merge pull request #2456 from Diapolo/code-layout
small indentation, space, formatting fixes (no code changes)
2013-04-05 18:15:23 -07:00
Philip Kaufmann b001c87126 small indentation, space, formatting fixes (no code changes) 2013-04-06 02:29:33 +02:00
Wladimir J. van der Laan c19c1d00d9 Merge pull request #2443 from Diapolo/Qt_addrbook
Bitcoin-Qt: updates to addressbookpage
2013-04-05 11:24:06 -07:00
Pieter Wuille 430cbad411 Merge pull request #2460 from Diapolo/clientmodel
Bitcoin-Qt: add Genesis blocks time for testnet
2013-04-05 02:37:24 -07:00
Wladimir J. van der Laan 369e3df0f8 Merge pull request #2442 from Diapolo/Qt_RPCCon
Bitcoin-Qt: small RPCConsole cleanup
2013-04-05 01:24:15 -07:00
Wladimir J. van der Laan d37fb2070d Merge pull request #2444 from jonasschnelli/master
new mac osx icon
2013-04-05 01:19:09 -07:00
Philip Kaufmann 8d432cd66d Bitcoin-Qt: add Genesis blocks time for testnet
- add the Genesis blocks time for the testnet in
  ClientModel::getLastBlockDate()
2013-04-04 22:15:47 +02:00
Pieter Wuille cedaa71446 Drop release times for CNode
It seems there were two mechanisms for assessing whether a CNode
was still in use: a refcount and a release timestamp. The latter
seems to have been there for a long time, as a safety mechanism.

However, this timer also keeps CNode objects alive for far longer
than necessary after disconnects, potentially opening up a DoS
window.

This commit removes the timestamp-based mechanism, and replaces
it with an assert(nRefCount >= 0), to verify that the refcounting
is indeed correctly working.
2013-04-04 14:45:45 +02:00
Gavin Andresen aaf47eac3a Merge pull request #2423 from TheBlueMatt/limitedmapalreadyaskedfor
Limited mapAlreadyAskedFor
2013-04-03 18:31:35 -07:00
Gavin Andresen a0a437c86a Merge pull request #2357 from gavinandresen/shutdowncleanup
Thread / shutdown cleanup
2013-04-03 18:25:00 -07:00
Gavin Andresen 1c4f02139c Merge pull request #2453 from sipa/txstats
Update transaction statistics
2013-04-03 18:23:50 -07:00
Pieter Wuille 92a129980f Update transaction statistics
As these were not updated when 'backporting' the 225430 checkpoint
into head.

Additionally, also report verification progress in debug.log, and
tweak the sigcheck-verification-speed-factor a bit.
2013-04-04 02:39:44 +02:00
Gavin Andresen 723035bb68 Have Qt poll for shutdown requested, the QT way. 2013-04-03 19:58:47 -04:00
Gavin Andresen b31499ec72 Clean up shutdown process 2013-04-03 19:57:53 -04:00
Gavin Andresen 21eb5adadb Port Thread* methods to boost::thread_group 2013-04-03 19:57:13 -04:00
Gavin Andresen 72f14d26ec LoopForever and ThreadTrace helpers 2013-04-03 19:57:13 -04:00
Philip Kaufmann b9564d7e54 Bitcoin-Qt: updates to addressbookpage
- use labelExplanation for sending and receiving tab and move the string
  from the ui-file to the source
- ensure that the table holding the label and address is resized so that
  the address column fits the address and the label column is stretched to
  fit the window size
- rename some stuff for much easier readbility in the code (I find it hard
  to get the meaning of stuff like labels or buttons)
2013-04-03 22:30:59 +02:00
Gavin Andresen 1b43bf0d3a Rename util.h Sleep --> MilliSleep
Two reasons for this change:
1. Need to always use boost::thread's sleep, even on Windows, so the
sleeps can be interrupted (prior code used Windows' built-in Sleep).

2. I always forgot what units the old Sleep took.
2013-04-03 14:04:21 -04:00
Gavin Andresen c8c2fbe07f Shutdown cleanup prep-work
Create a boost::thread_group object at the qt/bitcoind main-loop level
that will hold pointers to all the main-loop threads.

This will replace the vnThreadsRunning[] array.

For testing, ported the BitcoinMiner threads to use its
own boost::thread_group.
2013-04-03 14:04:21 -04:00
Gavin Andresen 87b9931bed Fix signed/unsigned comparison warnings 2013-04-03 14:04:21 -04:00
Wladimir J. van der Laan 36fdfb989e Merge pull request #2450 from Diapolo/Qt_fix_VMTab
Bitcoin-Qt: fix opening verify message tab via main menu
2013-04-03 09:26:18 -07:00
Philip Kaufmann 8726de26ee Bitcoin-Qt: fix GUI after initial multi-wallet patch
- adds 6 methods in BitcoinGUI to access some actions needed by the new
  WalletView class
- updates WalletView class to use these instead of trying to duplicate
  these
- cleanup walletview.{cpp/h} and remove all unneeded stuff
- this fixes problems with tabs toolbar (#2451) and export broken (#2436)
- more details in #2447
2013-04-03 17:37:28 +02:00
Philip Kaufmann 0dcf9e5308 Bitcoin-Qt: fix opening verify message tab via main menu 2013-04-03 15:28:16 +02:00
Wladimir J. van der Laan 4240bdaac1 Merge pull request #2448 from Diapolo/Qt_qApp
Bitcoin-Qt: only use qApp for Q(Core)Application::instance()
2013-04-02 20:30:44 -07:00
Jonas Schnelli 72fcbb15ea new mac osx icon (including SVG Version)
- added new created and documented svg version of shaded icon
- changed "B" background to white (no longer transparent)
- removed PSD (Adobe Photoshop) document
- license is now MIT

Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
2013-04-02 21:57:41 +02:00
Jonas Schnelli 6f21d15375 Merge branch 'master' of git://github.com/bitcoin/bitcoin 2013-04-02 21:53:41 +02:00
Gavin Andresen d8aae1ce1d Merge pull request #2420 from sipa/globclean
Global cleanups
2013-04-02 10:00:31 -07:00
Gavin Andresen 06db61f09e Merge pull request #2431 from jgarzik/gen-bitcoins-init
Move GenerateBitcoins() call out of net.cpp's StartNode()
2013-04-02 08:56:57 -07:00
Philip Kaufmann 1ce0448808 Bitcoin-Qt: only use qApp for Q(Core)Application::instance() 2013-04-02 17:33:48 +02:00
Philip Kaufmann bfad9982f8 Bitcoin-Qt: small RPCConsole cleanup
- add missing initalisation for clientModel
- remove unneded RPCExecutor::start() code
2013-04-02 16:42:23 +02:00
Wladimir J. van der Laan bcce45e9b0 Merge pull request #2441 from Diapolo/Qt_fix_copy_context_menu
Bitcoin-Qt: fix copy via context-menu broken
2013-04-02 07:34:35 -07:00
Philip Kaufmann 90bd933e6d translation base files update 2013-04-02
- also includes a small change to a string in bitcoinrpc.cpp, which is not
  on Transifex anyway, so is safe to merge
2013-04-02 15:46:40 +02:00
Philip Kaufmann 39ee86257c Bitcoin-Qt: fix copy via context-menu broken
- as QClipboard::Selection isn't available on Windows ensure that the
  correct mode is called, but sill allow selection for e.g. X11
- start conversion from QCoreApplication::instance() to qApp in
  guiutil.cpp (I intend to harmonize this all over the source with my Qt5
  compatibility pull)
2013-04-02 15:20:35 +02:00
Wladimir J. van der Laan a977b8c475 Merge pull request #2428 from r000n/staging
Simplify titles of tabs in main window
2013-04-02 05:41:24 -07:00
Jonas Schnelli aaa7f279c8 new mac osx icon
check why/preview: http://dl.dropbox.com/u/7383846/new_bitcoin_qt_mac_icon.png

- according to official bitcoin logo
- no chopped shadow
- retina-screen support

Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
2013-04-02 13:00:51 +02:00
Matt Corallo b5afda67f2 Move mapAlreadyAskedFor to limitedmap
This will result in re-requesting invs if we are under heavy inv
load, however as long as we get no more than 16,000 invs in two
minutes, this should have no effect on runtime behavior.
2013-04-01 11:56:23 -04:00
Matt Corallo 5ffc299404 Add a limitedmap class similar to mruset 2013-04-01 11:56:22 -04:00
Matt Corallo eb59c4ca8e Revert "Actually use mapAlreadyAskedFor."
This reverts commit 643160f6e7.

Turns out this commit was useless after a more careful reading of
CNode::AskFor
2013-04-01 11:56:22 -04:00
Wladimir J. van der Laan cf4d976f0e Merge pull request #2387 from Diapolo/translations
translations update 2013-03-19 (bitcoinstrings.cpp / bitcoin_en.ts)
2013-04-01 07:45:11 -07:00
Wladimir J. van der Laan 300f747ec3 Merge pull request #2437 from Diapolo/Qt_fixes
fix "send coins" via context menu in address book
2013-04-01 07:44:03 -07:00
Philip Kaufmann b2bf46d35e Bitcoin-Qt: fix debug window
- fix debug window, by re-adding rpcConsole->setClientModel(clientModel);
  in BitcoinGUI::setClientModel(), which was removed by #2220
2013-04-01 15:19:40 +02:00
Philip Kaufmann abf11f79ae fix "send coins" via context menu in address book
- the send coins context menu entry was not working anymore, because
  a non current version of #2220 was merged onto current master
- also removes some unneeded spaces and adds a comment to
  WalletModel::getNumTransactions()
2013-04-01 14:43:50 +02:00
Wladimir J. van der Laan 36599db428 qt: remove transaction count from overview page
It was needlessly confusing people, as it doesn't necessarily match the
number of transactions in the transaction list.
2013-03-31 10:16:43 +02:00
Roman Mindalev 0de26d5826 Words in English language are more short than in other langs usually.
Tabs don't fits in line in Spanish/German/Russian when they has two words.
Wallet has limited functionality. It can send & receive coins. So we can
safely rename "Send coins" to "Send" and "Receive coins" to "Receive".
Address book is just stored addresses.
2013-03-31 11:15:43 +04:00
Jeff Garzik a0cafb7945 Move GenerateBitcoins() call out of net.cpp's StartNode()
The internal miner is closely bound to the wallet engine,
not the blockchain engine.
2013-03-31 01:54:27 -04:00
Wladimir J. van der Laan 9d8d85920a Merge pull request #2386 from Diapolo/Mac_GUI
Bitcoin-Qt: ensure createTrayIconMenu() is always called on Mac
2013-03-30 22:51:43 -07:00
Wladimir J. van der Laan a7cbb340bd Merge pull request #2361 from L2G/font-tweak
Clean up font size in main window for observed inconsistency in Mac OS
2013-03-30 22:49:09 -07:00
Pieter Wuille 767fe14a27 Merge pull request #2422 from sipa/nowalcache
Don't use -dbcache for BDB anymore
2013-03-30 21:19:09 -07:00
Pieter Wuille c7f039b674 Process getdata invs separately until send buffer overflows
There exists a per-message-processed send buffer overflow protection,
where processing is halted when the send buffer is larger than the
allowed maximum.

This protection does not apply to individual items, however, and
getdata has the potential for causing large amounts of data to be
sent. In case several hundreds of blocks are requested in one getdata,
the send buffer can easily grow 50 megabytes above the send buffer
limit.

This commit breaks up the processing of getdata requests, remembering
them inside a CNode when too many are requested at once.
2013-03-30 18:14:54 +01:00
Philip Kaufmann 5968cf5db2 Bitcoin-Qt: ensure createTrayIconMenu() is always called on Mac
- this should prevent GUI issues on Mac that were observed before (disappearing
  GUI - see #1522)
- the patch ensures, that createTrayIconMenu() is always called on Mac to
  process and use our MacDockIconHandler
2013-03-30 10:14:45 +01:00
Pieter Wuille 41b052ad87 Use per-message send buffer, rather than per connection 2013-03-29 23:56:26 +01:00
Pieter Wuille 967f24590b Some fixes to CNetMessage processing
* Change CNode::vRecvMsg to be a deque instead of a vector (less copying)
* Make sure to acquire cs_vRecvMsg in CNode::CloseSocketDisconnect (as it
  may be called without that lock).
2013-03-29 23:56:26 +01:00
Jeff Garzik b9ff2970b9 P2P: improve RX/TX flow control
1) "optimistic write": Push each message to kernel socket buffer immediately.

2) If there is write data at select time, that implies send() blocked
   during optimistic write.  Drain write queue, before receiving
   any more messages.

This avoids needlessly queueing received data, if the remote peer
is not themselves receiving data.

Result: write buffer (and thus memory usage) is kept small, DoS
potential is slightly lower, and TCP flow control signalling is
properly utilized.

The kernel will queue data into the socket buffer, then signal the
remote peer to stop sending data, until we resume reading again.
2013-03-29 23:56:25 +01:00
Jeff Garzik bc2f5aa72c P2P, cosmetic: break out buffer send(2) code into separate function 2013-03-29 23:56:25 +01:00
Jeff Garzik 607dbfdeaf P2P: parse network datastream into header/data components in socket thread
Replaces CNode::vRecv buffer with a vector of CNetMessage's.  This simplifies
ProcessMessages() and eliminates several redundant data copies.

Overview:

* socket thread now parses incoming message datastream into
  header/data components, as encapsulated by CNetMessage
* socket thread adds each CNetMessage to a vector inside CNode
* message thread (ProcessMessages) iterates through CNode's CNetMessage vector

Message parsing is made more strict:

* Socket is disconnected, if message larger than MAX_SIZE
  or if CMessageHeader deserialization fails (latter is impossible?).
  Previously, code would simply eat garbage data all day long.
* Socket is disconnected, if we fail to find pchMessageStart.
  We do not search through garbage, to find pchMessageStart.  Each
  message must begin precisely after the last message ends.

ProcessMessages() always processes a complete message, and is more efficient:

* buffer is always precisely sized, using CDataStream::resize(),
  rather than progressively sized in 64k chunks.  More efficient
  for large messages like "block".
* whole-buffer memory copy eliminated (vRecv -> vMsg)
* other buffer-shifting memory copies eliminated (vRecv.insert, vRecv.erase)
2013-03-29 23:56:25 +01:00
Jeff Garzik ea83336f4e Merge pull request #2411 from TheBlueMatt/master
(finally) Remove IRC Seed support now that lfnet is down.
2013-03-29 08:03:18 -07:00
Jeff Garzik 8455310a7b Merge pull request #2385 from gavinandresen/alertnotify
alertnotify, so bitcoind users can get email/sms/whatever of alerts
2013-03-29 07:49:56 -07:00
Wladimir J. van der Laan 09dfa86baf qt: Improve capslock detection on non-us keyboards (issue #1855)
On non-us keyboards you can obtain lower case characters even pressing
the SHIFT, this caused false positives.
2013-03-29 10:55:23 +01:00
Wladimir J. van der Laan a6d32c94ab Merge remote-tracking branch 'codeshark/multiwallet-qt-no-core' (pull #2220)
Conflicts:
	src/qt/bitcoingui.cpp
2013-03-29 09:54:00 +01:00
Wladimir J. van der Laan 1be4bbadc7 Merge pull request #2350 from DavidGriffith/master
Also copy the address to the X11 clipboard (the one you middle-click to paste)
2013-03-29 01:45:59 -07:00
Wladimir J. van der Laan 8142ac2c18 Merge pull request #2393 from r000n/staging
Staging - GUI fixes for upstream
2013-03-29 01:40:32 -07:00
Pieter Wuille 2e3c76bf98 Don't use -dbcache for BDB anymore
-dbcache was originally used to set the maximum buffer size in the
BDB environment, and was later changed to set the chainstate cache
and leveldb caches. No need to use it for BDB now that only the
wallet remains there.

This should reduce memory allocation (but not necessarily memory
usage) a bit.
2013-03-29 03:02:52 +01:00
Pieter Wuille 3427517d50 Clean up global datastructures at shutdown.
This should make detecting leaks much easier.
2013-03-29 02:24:18 +01:00
Larry Gilbert 15e9739f3b Don't specify a point size for "Wallet" 2013-03-27 21:16:35 -07:00
Matt Corallo 6a1d6e03da Add a new testnet dnsseed (currently only static list, will update) 2013-03-24 20:02:18 -04:00
Matt Corallo c2efd981aa (finally) Remove IRC Seed support now that lfnet is down. 2013-03-24 19:38:19 -04:00
Gregory Maxwell 14c9d116be Make explicitly requested salvage operations keep going when there is an error.
In my tests corrupted wallets would often result in BDB dropping an error
just due to duplicate records being found, which appears harmless.
2013-03-24 12:59:03 -07:00
Roman Mindalev f688056f9d Show window in center of screen on first launch 2013-03-23 08:21:42 +04:00
Roman Mindalev e11f1806b6 Save & restore window size and position 2013-03-23 08:21:33 +04:00
Roman Mindalev afee36d379 Fix transaction fee in uBTC
Step for buttons 'up' and 'down' - 0.001. With BTC and mBTC all ok, but
0.001 uBTC is lower than minimal value (satoshi)
User should press 10 times on 'up' button to get 0.01 uBTC
2013-03-23 08:20:51 +04:00
Gregory Maxwell e3800824d6 Make MIN_TX_FEE match MIN_RELAY_TX_FEE.
Current relay behavior is widely deployed. Supplying a higher minfee than
mining and relaying just irritates users without anti-spam gain.
2013-03-22 17:48:40 -07:00
Eric Lombrozo 67155d9299 Minimal architectural changes necessary to support multiple wallets in bitcoin-qt
- This commit is a minimal restructuring necessary to support multiple wallets in the UI. Please see multiwallet-qt.txt for details.
2013-03-22 11:09:08 -07:00
Gavin Andresen 3d9d2d423b Recommend alertnotify 2013-03-21 10:08:21 -04:00
Richard Schwab 598889973b Adding 'copy txid' to qt tx overview context menu 2013-03-21 11:30:12 +01:00
Philip Kaufmann 967125ca4a blockchain -> block chain (used everywhere else) 2013-03-21 08:23:23 +01:00
Philip Kaufmann 48253c16bf translations update 2013-03-19 (bitcoinstrings.cpp / bitcoin_en.ts) 2013-03-19 23:47:45 +01:00
Gavin Andresen 8ab14e6976 Merge pull request #2384 from gmaxwell/trim_error0
Deleting everything except the wallet will not help recover from BDB errors.
2013-03-19 14:20:22 -07:00
Gavin Andresen e5f163a041 -alertnotify=<cmd>
Runs a shell command when an AppliesToMe() alert is received.
%s in the <cmd> string is replaced with the alert.strStatusBar
message.
2013-03-19 15:16:30 -04:00
Gregory Maxwell 124f823714 Deleting everything except the wallet will not help recover from BDB errors.
Now that the wallet is the only thing in BDB any DB open errors must be
from the wallet itself-- so deleting everything else will not likely help.
2013-03-19 10:11:43 -07:00
Wladimir J. van der Laan 1a1ce49155 Merge pull request #2378 from Diapolo/translations
update bitcoin_en.ts and bitcoinstrings.cpp
2013-03-19 10:01:05 -07:00
Wladimir J. van der Laan f42720d0f6 Merge pull request #2215 from Diapolo/Qt_sendfrom_addrbook
Bitcoin-Qt: add "send coins" to context menu in addressbook
2013-03-19 09:59:38 -07:00
Wladimir J. van der Laan b804f1cd56 Merge pull request #2332 from Diapolo/init_messages
harmonize 2 init messages and remove one
2013-03-19 09:57:57 -07:00
Gavin Andresen 1472308d67 Some unit tests for CAlert 2013-03-19 11:35:04 -04:00
Philip Kaufmann 2547d2a90b Bitcoin-Qt: update Win executable file meta-data copyright 2013-03-19 00:04:54 +01:00
Philip Kaufmann c83dd7490c update bitcoin_en.ts and bitcoinstrings.cpp 2013-03-18 08:29:36 +01:00
Philip Kaufmann 311993ab10 Bitcoin-Qt: add "send coins" to context menu in addressbook
- allows to directly select an address from the addressbook, chose "send
  coins" from the context menu, which sends you to sendcoins tab and fills
  in the selected address
2013-03-18 07:44:22 +01:00
Wladimir J. van der Laan 74e4d80068 Merge pull request #2210 from Diapolo/Qt_header_cpp_cleanup
Bitcoin-Qt: massive header and cpp cleanup
2013-03-17 22:58:37 -07:00
Gavin Andresen d3e8c6a9d3 Update unit test to match rule enforcement starts 21 March 2013-03-17 22:01:59 -04:00
Gavin Andresen f817c496a1 Checkpoint at first block in 11 March chain fork 2013-03-17 21:53:17 -04:00
Gavin Andresen 402f19b645 Before 15 May, limit created block size to 500K 2013-03-17 21:53:01 -04:00
Gavin Andresen 8c222dca4f CheckBlock rule until 15-May for 10,000 BDB lock compatibility 2013-03-17 21:52:47 -04:00
Philip Kaufmann 32af5266cf Bitcoin-Qt: massive header and cpp cleanup
- try to enforce the same style to all Qt related files
- remove unneeded includes from the files
- add missing Q_OBJECT, QT_BEGIN_NAMESPACE / QT_END_NAMESPACE
- prepares for a pull-req to include Qt5 compatibility
2013-03-17 18:28:00 +01:00
Philip Kaufmann e1ca89df1f harmonize 2 init messages and remove one
- harmonize the database related init messages
- as we have a thread for importing blocks, that init message is obsolete
2013-03-13 09:17:59 +01:00
Gavin Andresen 1a9ee5da32 Merge pull request #2336 from petertodd/invalid-opcode-coverage
Explicitly unittest the canonical prunable txout format
2013-03-11 16:16:51 -07:00
David Griffith 4db114667f Also copy the address to the X11 clipboard (the one you middle-click to paste) 2013-03-09 00:37:21 -08:00
freewil 10ef361169 CRPCCommand.unlocked -> CRPCCommand.threadSafe
unlocked could be confused with wallet encryption
2013-03-07 06:18:55 -05:00
freewil dcf8b8fd9e make vRPCCommands comment match property names 2013-03-07 05:29:18 -05:00
Peter Todd 091f184190 Test canonical prunable txout format explicitly 2013-03-01 02:41:28 -05:00
Peter Todd 6131d1d9df Add coverage for all invalid ops
0xba thru 0xff
2013-03-01 02:24:08 -05:00
mb300sd 550479b09f add address and account information to listunspent 2013-02-27 22:13:43 -05:00
Matt Corallo cbfc77352d Short-circuit bloom checking if we will always return true.
This allows full nodes to use bloom filters as an optimization.
2013-02-24 20:36:59 -05:00
Wladimir J. van der Laan 0bd573d666 Merge pull request #2186 from Diapolo/misc_stuff
small changes in init, main, checkpoints.h and bitcoin-qt.pro
2013-02-23 23:52:27 -08:00
Wladimir J. van der Laan 7ea7c94cf9 Merge pull request #2299 from gavinandresen/localsocketuri
Reimplement click-to-pay. Support OSX.
2013-02-23 23:47:31 -08:00
Gavin Andresen cc67f1e2b4 Merge pull request #2221 from sipa/perfo
Various performance tweaks to CCoinsView
2013-02-22 09:01:30 -08:00
Gavin Andresen b8f4e42e1b Merge pull request #2229 from sipa/prealloc
Native versions for AllocateFileRange()
2013-02-22 09:00:13 -08:00
Gavin Andresen 9dca7190f9 Merge pull request #2310 from sipa/progressbar
Progressbar based on time-based estimation of transactions.
2013-02-22 08:59:36 -08:00
Gavin Andresen aaeb443791 Merge pull request #2312 from gmaxwell/random_random
ApproximateBestSubset internal RNG to prevent degenerate behavior.
2013-02-22 08:57:38 -08:00
Gavin Andresen 1167af7e5c Merge pull request #2308 from apoelstra/safemode-privkey
Enable dumpprivkey in safe mode
2013-02-22 08:50:12 -08:00
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
Andrey 1a20469428 Updated help and tests for getreceivedby(account|address) 2012-12-16 23:10:32 +04: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
Andrey 62c9b1155f listreceivedbyaddress now provides tx ids (issue #1149) 2012-12-13 18:59:10 +04: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
Richard Schwab 303b0009dc Change timestamps to use ISO8601 formatting 2012-12-12 16:32:22 +01:00
Andrey Alekseenko 6a3aef39e7 OptionsModel now has MapPortUPnP=false if UPNP is not supported 2012-12-12 13:10:02 +04:00
Gavin Andresen 5d32d3f8cd Checkpoint at first 25-btc-reward block (210,000) 2012-12-10 09:53:22 -05:00
Pieter Wuille 622da5df6e Merge pull request #2068 from Diapolo/CheckDiskSpace
some CheckDiskSpace() related changes
2012-12-07 13:33:24 -08:00
Mike Cassano 44051af1a8 add rescan bool to importprivkey to control whether to do a rescan after import 2012-12-06 20:18:17 -06:00
Pieter Wuille 3fb9b99cca Allow lengthy block reconnections to be interrupted
When the coin database is out of date with the block database, the
best block in it is automatically switched to. This reconnection
process can take time, so allow it to be interrupted.

This also stops block connection as soon as shutdown is requested,
leading to a faster shutdown.
2012-12-06 22:04:59 +01:00
Pieter Wuille c8b2e4426b Update the block file counter in database when using -reindex
This problem is like earth (mostly harmless). After/during a
-reindex, it means the statistics about the last block file
reported in debug.log are always of blk00000.dat instead of the
last file. Apart from that, it means a few more database entries
need to be read when finding a file to append to the first time.
2012-12-06 22:04:58 +01:00
Pieter Wuille 89b7019be8 Reconstruct coins/ from scratch when missing. 2012-12-06 17:00:12 +01:00
Pieter Wuille d79775a04d Merge pull request #2057 from Diapolo/FlushBlockFile
FlushBlockFile(): check for valid FILE pointer
2012-12-06 01:35:36 -08:00
Wladimir J. van der Laan 25fd38090a Merge pull request #2066 from Diapolo/small_uiint_changes
UI interface changes
2012-12-05 23:30:06 -08:00
Pieter Wuille cd1391ae4d Merge pull request #2056 from sipa/fix_2052
Fixes for obscure mempool-checkpoint interaction
2012-12-05 14:15:17 -08:00
Pieter Wuille 8a28bb6dee Add -benchmark for reporting block processing times 2012-12-05 23:06:01 +01:00
Pieter Wuille 0ae0712b1c Add GetTimeMicros() for ore accurate benchmarking 2012-12-05 23:06:01 +01:00
Pieter Wuille a485c1b69e Merge pull request #2063 from Diapolo/CDiskBlockPos
add 2 constructors in CDiskBlockPos to simplify class usage
2012-12-05 14:01:03 -08:00
Philip Kaufmann fa45c26a0e call CheckDiskSpace() before pre-allocating space
- even if we are allowed to fail pre-allocating, it's better to check
  for sufficient space before calling AllocateFileRange() and if we
  are out of disk space return with error()
- the above change allows us to remove the CheckDiskSpace() check
  in CBlock::AcceptBlock()
2012-12-05 14:39:09 +01:00
grimd34th 679131b235 Update src/makefile.mingw
With MinGW we use .a not .lib
2012-12-04 16:00:47 -05:00
Philip Kaufmann 15d8ff2029 rework ThreadSafeAskFee() / askFee() functions
- remove unused parameter from ThreadSafeAskFee(), which also results in
  the removal of an orphan translation-string
2012-12-04 21:35:41 +01:00
Philip Kaufmann 7f5a1b529b remove unneeded flag from MSG_INFORMATION and fix an indentation 2012-12-04 21:35:40 +01:00
Pieter Wuille 469e606141 Merge pull request #2058 from sipa/atomicreorg
Make SetBestChain() atomic
2012-12-03 15:11:31 -08:00
Philip Kaufmann 50ecd7b689 use new message() function in BitcoinGUI
- use it for displaying URI parsing warnings
- use it for displaying error and information in backup wallet function
  (the information display is new and the error was a warning before)

- cleanup BitcoinGUI::incomingTransaction()
-- use message() + the information icon from message
-- comment out an unused parameter in the function definition and
   declaration
-- move all pre-checks at the beginning of the function
2012-12-03 14:02:02 +01:00
Philip Kaufmann 3675588a30 Bitcoin-Qt: remove obsolete modal flag from GUI APIs
- as we (can) supply the CClientUIInterface::MODAL flag via the style
  parameter, we don't need a separate bool for checking the modality
2012-12-03 13:24:42 +01:00
Wladimir J. van der Laan 7a8dd98863 Merge pull request #2046 from Diapolo/traymenu
split of createTrayIconMenu() from createTrayIcon() in BitcoinGUI
2012-12-03 01:53:18 -08:00
Philip Kaufmann a8a4b9673e add 2 constructors in CDiskBlockPos to simplify class usage
- add a default-constructor, which simply calls SetNull() and a
  constructor to directly pass nFile and nPos
- change code to use that new constructors
2012-12-03 10:19:17 +01:00
Pieter Wuille d33a9218ab Make SetBestChain() atomic
In case a reorganisation fails, the internal state could become
inconsistent (memory only). Previously, a cache per block connect
or disconnect action was used, so blocks could not be applied in
a partial way. Extend this to a cache for the entire reorganisation,
making it atomic entirely. This also simplifies the code a bit.
2012-12-02 01:43:35 +01:00
Philip Kaufmann b19388dd88 FlushBlockFile(): check for valid FILE pointer
- don't call FileCommit() and fclose() if no valid FILE pointer was
  returned by OpenBlockFile()
2012-12-01 11:36:53 +01:00
Pieter Wuille cd7fb7d1de Merge pull request #2033 from sipa/kickconflicts
Bugfix: remove conflicting transactions from memory pool
2012-11-30 17:10:07 -08:00
Pieter Wuille 8259c57321 Only send reorged txn to mempool after checkpoint 2012-12-01 02:09:41 +01:00
Gavin Andresen aaef016a07 Merge pull request #2037 from luke-jr/printpriority
Allow -printpriority without -debug
2012-11-30 16:16:59 -08:00
Pieter Wuille 038784b979 Enable script verification for reorganized mempool tx 2012-12-01 00:45:17 +01:00
Pieter Wuille 487db8a2b1 Make test_bitcoin run in a temp datadir 2012-11-29 22:09:16 +01:00
Pieter Wuille 597fa4cd63 Add GetTempPath() to util 2012-11-29 01:00:35 +01:00
Jeff Garzik e6955d0411 New 'checkpoints' option should default to true. 2012-11-28 12:10:57 -05:00
Jeff Garzik 857b3ad923 Add "checkpoints" option, to permit disabling of checkpoint logic. 2012-11-28 12:07:42 -05:00
Wladimir J. van der Laan 5c37be2db6 Merge pull request #2044 from Diapolo/backupwallet
do not silently ignore errors on "backupwallet" RPC cmd
2012-11-27 23:41:50 -08:00
Philip Kaufmann f82102121f split of createTrayIconMenu() from createTrayIcon() in BitcoinGUI
- this allows to setup the trayicon before we have and want a trayicon menu
- should be of great use, when we remove that splash screen
- fixes a small bug with the toggleHideAction icon, which is not only used with
  trayicon but also with the Mac dock
2012-11-27 22:20:43 +01:00
Pieter Wuille 0c50d8b007 Merge pull request #2006 from robbak/make-leveldb-macro
Change 'make' to $(MAKE) in leveldb make command line
2012-11-27 12:49:37 -08:00
Philip Kaufmann ad525e9c8f do not silently ignore errors on "backupwallet" RPC cmd 2012-11-27 16:27:54 +01:00
Luke Dashjr 2646080e3d Allow -printpriority without -debug 2012-11-26 16:30:54 +00:00
Philip Kaufmann 5350ea4171 update CClientUIInterface and remove orphan Wx stuff
- fix ThreadSafeMessageBox always displays error icon
- allow to specify MSG_ERROR / MSG_WARNING or MSG_INFORMATION without a
  custom caption / title
- allow to specify CClientUIInterface::ICON_ERROR / ICON_WARNING and
  ICON_INFORMATION (which is default) as message box icon
- remove CClientUIInterface::OK from ThreadSafeMessageBox-calls, as
  the OK button will be set as default, if none is specified
- prepend "Bitcoin - " to used captions
- rename BitcoinGUI::error() -> BitcoinGUI::message() and add function
  documentation
- change all style parameters and enum flags to unsigned
- update code to use that new API

- update Client- and WalletModel to use new BitcoinGUI::message() and
  rename the classes error() method into message()
- include the possibility to supply the wanted icon for messages from
  Client- and WalletModel via "style" parameter
2012-11-26 13:32:31 +01:00
Pieter Wuille 231b399952 Bugfix: remove conflicting transactions from memory pool
When a transaction A is in the memory pool, while a transaction B
(which shares an input with A) gets accepted into a block, A was
kept forever in the memory pool.

This commit adds a CTxMemPool::removeConflicts method, which
removes transactions that conflict with a given transaction, and
all their children.

This results in less transactions in the memory pool, and faster
construction of new blocks.
2012-11-25 11:50:35 +01:00
Pieter Wuille 3ed1ccb089 Merge pull request #2004 from alexanderkjeldaas/simplify-cmutexlock
Simplify CMutexLock
2012-11-24 13:55:00 -08:00
Pieter Wuille 7818d230a2 Merge pull request #2013 from sipa/blockheader
Split off CBlockHeader from CBlock
2012-11-24 13:54:12 -08:00
burger2 ecd67a1420 Fix duplicate shortcut usage in sign/verify message dialog. 2012-11-22 22:50:30 +01:00
Pieter Wuille c07a1a6ee4 Merge pull request #1980 from sipa/noreorgsame
Do not reorganize if new branch has same amount of work
2012-11-22 13:33:03 -08:00
Wladimir J. van der Laan b0e228a4b0 Merge pull request #2024 from Diapolo/fix_qt_crash
Bitcoin-Qt: fix crash on Windows caused by CDBEnv::EnvShutdown()
2012-11-22 02:08:42 -08:00
Gavin Andresen a91efb2d8d Add assert and comment for subtle pay-to-script-hash logic 2012-11-21 13:58:10 -05:00
Philip Kaufmann be8e1f8479 Bitcoin-Qt: fix crash on Windows caused by CDBEnv::EnvShutdown()
- can be triggerd by just adding -proxy=crashme with 0.7.1
- crash occured, when AppInit2() was left with return false; after the
  first call to bitdb.open() (Step 6 in init)
- this is caused by GetDataDir() or .string() in CDBEnv::EnvShutdown()
  called via the bitdb global destructor
- init fDbEnvInit and fMockDb to false in CDBEnv::CDBEnv()
2012-11-18 14:10:26 +01:00
Wladimir J. van der Laan 4725e96a3a Merge pull request #2022 from Diapolo/fix_#2018
fix pull #2018
2012-11-17 01:00:20 -08:00
Philip Kaufmann 11406c89fe ConnectBlock(): fix error() format to be unsigned
- I introduced the wrong format macro with my former patch (#2018), this
  needs to be signed not unsigned (thanks Luke-Jr)
2012-11-17 09:57:58 +01:00
Wladimir J. van der Laan 98e7771ca1 Merge pull request #2019 from Diapolo/bitcoinstrings_upd
update bitcoinstrings.cpp and bitcoin_en.ts
2012-11-16 17:29:04 -08:00
Philip Kaufmann baa510b210 update bitcoinstrings.cpp and bitcoin_en.ts 2012-11-16 19:02:39 +01:00
Gavin Andresen e45d39f9ee Merge pull request #2009 from sipa/fixmove
Prevent RPC 'move' from deadlocking
2012-11-16 08:09:41 -08:00
Philip Kaufmann 42152c3da9 ensure we use our format macros to avoid compilation warnings
- fixes 2 warnings I observed while compiling on Windows with MinGW
2012-11-16 08:29:47 +01:00
Wladimir J. van der Laan 0c42ee8130 Merge pull request #1767 from Diapolo/RPCCon_clear_history
clear history when using clear button in RPC console
2012-11-15 22:31:12 -08:00
Jeff Garzik 3ef292dc7d Merge pull request #1670 from luke-jr/blksubstr
Use full block hash as unique identifier in debug.log
2012-11-15 18:47:07 -08:00
Jeff Garzik 848c0d5d95 Merge pull request #1945 from centromere/leveldb_fix
Fixed compile error on FreeBSD 9.
2012-11-15 18:31:20 -08:00
Jeff Garzik 34ea321ccd Merge pull request #1987 from jgarzik/no-pw-match
RPC: Forbid RPC username == RPC password
2012-11-15 18:22:50 -08:00
Jeff Garzik 824e196054 Merge pull request #2005 from Diapolo/fixes_main
some small fixes for main.cpp/.h
2012-11-15 18:20:35 -08:00
Jeff Garzik a0bf93b809 Merge pull request #2012 from luke-jr/invblk_errs
Print error for coinbase-pays-too-much case of ConnectBlock failing
2012-11-15 18:18:55 -08:00
Jeff Garzik fdbb537d26 Add new RPC "lockunspent", to prevent spending of selected outputs
and associated RPC "listlockunspent".

This is a memory-only filter, which is empty when a node restarts.
2012-11-15 21:11:30 -05:00
Jeff Garzik 7e1610d51e RPC: Forbid RPC username == RPC password
Added security measure.
2012-11-15 20:33:42 -05:00
Pieter Wuille bb76267cc4 Merge pull request #2010 from Diapolo/bind_unsigned
make enum and parameter used in Bind() unsigned
2012-11-15 15:37:00 -08:00
Pieter Wuille e754cf4133 Split off CBlockHeader from CBlock
Cleaner and removes the need for the application-specific flags in
serialize.h.
2012-11-16 00:12:33 +01:00
Pieter Wuille 99d0d0f356 Introduce script verification flags
These flags select features to be enabled/disabled during script
evaluation/checking, instead of several booleans passed along.
Currently these flags are defined:
* SCRIPT_VERIFY_P2SH: enable BIP16-style subscript evaluation
* SCRIPT_VERIFY_STRICTENC: enforce strict adherence to pubkey/sig encoding standards.
2012-11-15 23:00:16 +01:00
Luke Dashjr 4ade04ddbd Print error for coinbase-pays-too-much case of ConnectBlock failing 2012-11-14 19:16:56 +00:00
Philip Kaufmann 29e214aaf5 make enum and parameter used in Bind() unsigned
- it's good practise to use unsigned int for enum flags, so change this
  one, as I introduced this for Bind()
2012-11-14 16:13:18 +01:00
Alexander Kjeldaas bfc9620799 Simplify CMutexLock
o Remove unused Leave and GetLock functions
o Make Enter and TryEnter private.
o Simplify Enter and TryEnter.
  boost::unique_lock doesn't really know whether the
  mutex it wraps is locked or not when the defer_lock
  option is used.
  The boost::recursive_mutex does not expose this
  information, so unique_lock only infers this
  knowledge.  When taking the lock is defered, it
  (randomly) assumes that the lock is not taken.
  boost::unique_lock has the following definition:

        unique_lock(Mutex& m_,defer_lock_t):
            m(&m_),is_locked(false)
        {}

        bool owns_lock() const
        {
            return is_locked;
        }
  Thus it is a mistake to check owns_lock() in Enter
  and TryEnter - they will always return false.
2012-11-14 00:00:23 -03:00
Pieter Wuille 4291e8feab Prevent RPC 'move' from deadlocking
It seemed to create two CWalletDB objects that both grab the
database lock.
2012-11-14 00:31:56 +01:00
Luke Dashjr c34a32699e Change block references in debug.log to full hash instead of just 0..20 2012-11-13 21:19:58 +00:00
Luke Dashjr f3a84c3a6b Abstract block hash substr extraction (for debug.log) into BlockHashStr inline 2012-11-13 21:18:32 +00:00
Philip Kaufmann 966a0e8cc9 add CWalletTx::GetImmatureCredit() and use it in CWallet::GetImmatureBalance() 2012-11-13 07:56:48 +01:00
Wladimir J. van der Laan 0d5b1d2a3e Merge pull request #2002 from alexanderkjeldaas/clang-warnings
o Removed verbose clang warning
2012-11-12 22:26:08 -08:00
Robert Backhaus 978770b59d Change 'make' to $(MAKE) in leveldb make command line 2012-11-13 11:45:07 +10:00
Philip Kaufmann 13e5cce4c3 some small fixes for main.cpp/.h
- remove an unwanted ";" at the end of the ~CCoinsView() destructor
- in FindBlockPos() and FindUndoPos() only call fclose(), is file is open
- fix an error string in the CBlockUndo class
2012-11-11 13:16:42 +01:00
Pieter Wuille e12efb9d33 Merge pull request #1970 from Arnavion/fix-make-leveldb
leveldb cannot compile with custom CFLAGS / CXXFLAGS / LDFLAGS
2012-11-11 03:20:29 -08:00
Pieter Wuille 537c890f24 Merge pull request #1997 from Diapolo/bdb_open
simplify CDBEnv::Open() / fix small glitches
2012-11-11 03:16:52 -08:00
Pieter Wuille 337f876cbb Merge pull request #2000 from Diapolo/fix_indentation
fix some missing indentations in main.cpp for better readability
2012-11-11 02:23:10 -08:00
Alexander Kjeldaas 25511af4a5 o Annotated lock-like functions in net.h.
o Removed unused function EndMessageAbortIfEmpty
2012-11-11 00:55:48 -03:00
Alexander Kjeldaas 05f97d1263 o Added AnnotatedMixin which adds locking annotations to the mutex
API, compatible with clang's -Wthread-safety
2012-11-11 00:55:48 -03:00
Alexander Kjeldaas c043ff79e3 o Added threadsafety.h - a set of macros using the -Wthread-safety
feature in clang.  These macros should primarily be used to
  document which locks protect a given piece of data.  Secondary it
  can be used to document the set of held and excluded locks when
  entering a function.
2012-11-11 00:53:00 -03:00
Alexander Kjeldaas 40c5e409e1 o Removed verbose clang warning 2012-11-11 00:25:19 -03:00
Pieter Wuille 6ca2ea2fa2 Merge pull request #1979 from sipa/corefndoc
One-line comments for public main functions
2012-11-10 13:47:00 -08:00
Pieter Wuille 160b028b88 One-line comments for public main functions 2012-11-10 22:40:21 +01:00
Pieter Wuille 45a9365f18 Fix status text after reindex 2012-11-10 22:08:46 +01:00
Gregory Maxwell 91cee34638 Merge pull request #1992 from Diapolo/no_memset
don't use memset() in privacy/security relevant code parts
2012-11-10 09:29:32 -08:00
Philip Kaufmann b56585d067 fix some missing indentations in main.cpp for better readability 2012-11-10 14:26:34 +01:00
Wladimir J. van der Laan e88f8887b6 Merge pull request #1977 from Diapolo/rem_printf_redef_rpc
remove printf redefinition from bitcoinrpc.cpp
2012-11-10 03:47:11 -08:00
Wladimir J. van der Laan d7db72998b Merge pull request #1993 from Diapolo/qt_header_cleanup
Qt: small header changes / fixes
2012-11-10 03:46:35 -08:00
Philip Kaufmann c74bae0fdf simplify CDBEnv::Open() / fix small glitches
- remove pathEnv from CDBEnv, as this attribute is not needed
- change path parameter in ::Open() to a reference
- make nDbCache variable an unsigned integer
- remove a missplaced ";" behin ::IsMock()
2012-11-10 01:11:22 +01:00
Philip Kaufmann c73323eec9 allow listening on -bind=address for blocked networks
- this allows the client to listen on via -bind specified addresses
  (e.g. 127.0.0.1), even when a network (IPv4 in that case) was blocked
  via e.g -onlynet="Tor"
- introduce enum BindFlags to avoid passing multiple bools to Bind()
- make -bind help text clear we ALWAYS listen on the specified address
- remove an unused variable
- remove 2 unneeded IsLimited() checks before calling Bind(), which does
  these checks anyway

- usage case: specify -bind=127.0.0.1 -onlynet="Tor" to allow incoming
  connections to a Tor hidden service, but still don't allow other IPv4
  nodes to connect / get connected
2012-11-10 00:29:12 +01:00
Pieter Wuille c7075c4b65 Fix tests after cache tweaks 2012-11-10 00:09:57 +01:00
Pieter Wuille 485cf044ba Merge pull request #1943 from sipa/reindex2
Add -reindex, to perform in-place reindexing of block chain files
2012-11-09 14:50:30 -08:00
Jeff Garzik 8146591a53 Merge branch 'http-improvements'
The base bits of pull req #1982.
2012-11-09 17:34:25 -05:00
Pieter Wuille b41de54a2c Merge pull request #1978 from sipa/nodetach
Remove -detachdb and stop's detach argument.
2012-11-09 14:10:50 -08:00
Philip Kaufmann d0b0925be9 make CBase58Data class use zero_after_free_allocator
- this way there is no need for an explicit destructor, who does the same
  thing anyway
2012-11-09 19:25:20 +01:00
Philip Kaufmann 0f8a647782 don't use memset() in privacy/security relevant code parts
As memset() can be optimized out by a compiler it should not be used in
privacy/security relevant code parts. OpenSSL provides the safe
OPENSSL_cleanse() function in crypto.h, which perfectly does the job of
clean and overwrite data.

For details see: http://www.viva64.com/en/b/0178/

- change memset() to OPENSSL_cleanse() where appropriate
- change a hard-coded number from netbase.cpp into a sizeof()
2012-11-09 12:53:53 +01:00
Pieter Wuille 7fea484674 Add -reindex, to perform in-place reindexing of block chain files
Flushes the blktree/ and coins/ databases, and reindexes the
block chain files, as if their contents was loaded via -loadblock.

Based on earlier work by Jeff Garzik.
2012-11-09 01:06:32 +01:00
Pieter Wuille 7a5b7535bf Move ThreadImport to init.cpp 2012-11-09 01:06:32 +01:00
Pieter Wuille 05d9726805 LoadExternalBlockFile switched to CBufferedFile 2012-11-09 01:06:06 +01:00
Pieter Wuille b5d5f44c95 Add CBufferedFile 2012-11-09 01:06:06 +01:00
Pieter Wuille 16d9d61f99 Merge pull request #1981 from sipa/caches
Cache size optimizations
2012-11-08 14:17:37 -08:00
Philip Kaufmann 128eefa0f8 Qt: small header changes / fixes
- ensure header inclusion guard is named after the header file
- add missing comments at the end of some inclusion guards
- add a small Qt5 compatibility fix in macdockiconhandler.h
2012-11-08 21:45:32 +01:00
Pieter Wuille cd6dc96c4f Do not reorganize if new branch has same amount of work 2012-11-05 21:24:11 +01:00
Wladimir J. van der Laan 86406daeca Merge pull request #1830 from Diapolo/trans_rem_spaces
fix some double-spaces in strings
2012-11-04 23:34:57 -08:00
Jeff Garzik fcf234fc08 RPC: HTTP server uses its own ReadHTTPRequestLine()
rather than reusing ReadHTTPStatus() from the client mode.

The following additional HTTP request validations are added, both in line with
existing HTTP client practice:

1) HTTP method must be GET or POST.  Most clients use POST, some
   use GET.  Either way, this continues to work.
2) HTTP URI must start with "/" character.
   Normal URI is "/" (a 1-char string), so this is fine.
2012-11-04 17:16:46 -05:00
Jeff Garzik 2306dc4b76 RPC, cosmetic: push down ReadHTTPStatus() calls into ReadHTTP() callers
ReadHTTPStatus() is currently overloaded:  In client mode, it properly parses
and receives an HTTP status line.  In server mode, it incorrectly parses the
HTTP request line as an HTTP status line.

This server mode bug has never mattered, because the RPC server never
cared about the URI (path) provided in the HTTP request.  That will change in
the future, so go ahead and begin fixing the problem.

This patch is cosmetic, and should result in NO behavior changes.

Further renames:
ReadHTTPHeader -> ReadHTTPHeaders
ReadHTTP -> ReadHTTPMessage
2012-11-04 16:06:38 -05:00
Pieter Wuille 1c83b0a377 Cache size optimizations 2012-11-04 18:06:25 +01:00
Pieter Wuille 92467073ad Remove -detachdb and stop's detach argument.
As the only BDB database left is the wallet, and it is always
detached.

Also remove IsChainFile() predicate and related chainfile-specific
logic.
2012-11-04 12:59:06 +01:00
Philip Kaufmann ed552cfae0 remove printf redefinition from bitcoinrpc.cpp
- as the redefiniton of printf happens in util.h, which is included in
  bitcoinrpc.cpp, we don't need another redefinition
2012-11-04 11:24:54 +01:00
Pieter Wuille a56d3f8a10 Merge pull request #1971 from sipa/bugfix_norelayspent
Bugfix: do not keep relaying spent wallet transactions
2012-11-03 11:51:13 -07:00
kjj2 cae686d31e Add -walletnotify to call an external script on wallet transactions 2012-11-03 10:07:57 -05:00
Pieter Wuille 9d6633ac0d Comments for constants 2012-11-03 00:14:43 +01:00
Pieter Wuille c9c7d4824f Add virtual destructor to CCoinsView 2012-11-01 22:54:06 +01:00
Pieter Wuille 5eaf91a428 Bugfix: do not keep relaying spent wallet transactions
The original test (checking whether the transaction occurs in the
txindex) is not usable anymore, as it will miss anything already
fully spent. However, as merkle transactions (and by extension,
wallet transactions) track which block they were last seen being
included in, we can use that to determine the need for
rebroadcasting.
2012-11-01 18:06:29 +01:00
Arnav Singh 8986a1369f Fixed making leveldb with custom CFLAGS/CXXFLAGS in the same way as makefile.unix 2012-11-01 08:29:17 -07:00
Philip Kaufmann 6f959c4cb3 Bitcoin-Qt: use statustips in addition to tooltips
- add setStatusTip() in addition to setTooltip() where it makes sense
- add only setStatusTip() if GUI element is only used in main- or tray menu

- add an event filter on our BitcoinGUI object to prevent garbelled text
  on the status bar, which happens when we use it for e.g. displaying
  block-sync state and then a QEvent::StatusTip wants to write own text to it

- remove a double translation of "Bitcoin client"
2012-10-31 08:05:27 +01:00
Wladimir J. van der Laan 578fc80003 Merge pull request #1932 from Diapolo/thread_printf
fix some thread related log messages
2012-10-30 23:19:35 -07:00
Pieter Wuille 41db7c224a Merge pull request #1963 from sipa/bugfix_nonewblock
Bugfix: don't crash by trying to write unchanged best block
2012-10-30 13:53:11 -07:00
Gavin Andresen ae8fc19788 Merge branch 'rawtx_p2sh' 2012-10-29 15:49:46 -04:00
Matt Corallo 38fe2e6a68 Add missing calls to ranlib in Windows makefiles 2012-10-29 15:43:18 -04:00
Matt Corallo f53b125507 Fix linux-mingw makefile's leveldb build by setting CXX. 2012-10-29 15:43:17 -04:00
Matt Corallo 3b4f8ad71d Use && instead of ; in leveldb calls to makefile. 2012-10-29 15:43:17 -04:00
Gavin Andresen 34226be7a8 New createmultisig rpc command
This is to support the signrawtransaction API call; given the public
keys involved in a multisig transaction, this gives back the redeemScript
needed to sign it.
2012-10-29 13:34:35 -04:00
Gavin Andresen 03346a61b1 Add redeemScript to listunspent output and signrawtransaction input
signrawtransaction was unable to sign pay-to-script-hash inputs
when given the list of private keys to use. With this commit
you can provide the p2sh redemption script in the list of
inputs.
2012-10-29 13:34:35 -04:00
Gavin Andresen 2d43f88e1f Tests for raw transactions argument checking 2012-10-29 13:34:35 -04:00
Gavin Andresen c4d884e20e No need for test fixture now that multisig is enabled on main network. 2012-10-29 13:34:35 -04:00
Pieter Wuille 28982cc9dc Remove P2SH transition code: P2SH violations may cause DoS trigger 2012-10-29 00:41:39 +01:00
Pieter Wuille 0b297a614f Bugfix: don't crash by trying to write unchanged best block 2012-10-28 19:14:51 +01:00
Philip Kaufmann 6b3783a9c9 fix some double-spaces in strings
- remove some unneeded stuff in sendcoinsentry.ui
- harmonize some "Error:"-messages
2012-10-25 22:25:50 +02:00
Pieter Wuille bb790aa24d First flush block tree, then coin set
As the coinset data refers to the best block, stored in the block
tree. Flushing the coin set first can cause inconsistencies if
the process gets killed in between.
2012-10-25 20:47:17 +02:00
tucenaber 3026baaa7c Added checks for null pointers in Shutdown
Estetics
2012-10-25 20:45:38 +02:00
Pieter Wuille 344620e953 Merge pull request #1904 from laanwj/2012_10_remove_getorder
remove "checkorder" P2P command
2012-10-25 11:41:22 -07:00
Pieter Wuille e74d0ab675 Merge pull request #1899 from Diapolo/proxy_optionsmodel
make optionsmodel query real proxy state for ::data()
2012-10-25 11:33:59 -07:00
Pieter Wuille 66444558a5 Merge pull request #1953 from gmaxwell/createnewblock-race
Fixes a race condition in CreateNewBlock and a future null deref on testnet.
2012-10-25 11:30:51 -07:00
Philip Kaufmann 847593228d fix some thread related log messages
- "ThreadIRCSeed started" was not displayed, even if the thread ran
  (although only for a short time as the "do we want this thread?"-checks
  happen IN ThreadIRCSeed2())
- the patch ensures we always get that message
- add a "ThreadIRCSeed trying to connect..." message
- add missing "ThreadDumpAddress started" message
2012-10-25 16:12:40 +02:00
Wladimir J. van der Laan 1f7c5c5a3e Merge pull request #1926 from laanwj/2012_10_maindummybounds
Fix out-of-bounds read in main (issue #1924)
2012-10-25 06:12:10 -07:00
Wladimir J. van der Laan 7a1786084d Merge pull request #1956 from laanwj/2012_10_prerelease_warning
Show warning when using prerelease version
2012-10-25 05:52:55 -07:00
Pieter Wuille 2e9e6641e1 Merge pull request #1955 from gmaxwell/gbt_paramfix
Don't force getblocktemplate to have a parameter.
2012-10-25 05:37:51 -07:00
Philip Kaufmann 83a3fb81f3 ensure AskPassphraseDialog::eventFilter forwards events
- instead of "return false;" use "return QDialog::eventFilter(object,
  event);" to harmonize this event filter with our default behaviour
- remove orphan spaces found while editting the files
2012-10-25 11:52:34 +02:00
Wladimir J. van der Laan 62e21fb5d0 Show warning when using prerelease version
Implements #1948

- Add macro `CLIENT_VERSION_IS_RELEASE` to clientversion.h
- When running a prerelease (the above macro is `false`):
  - In UI, show an orange warning bar at the top. This will be used for other
    warnings (and alerts) as well, instead of the status bar.
  - For `bitcoind`, show the warning in the "errors" field in `getinfo`
    response.
2012-10-25 07:33:45 +02:00
Gregory Maxwell 3beac9837f Don't force getblocktemplate to have a parameter.
This looks like it was just a munged merge when ultraprune
was committed.
2012-10-24 12:39:46 -04:00
Pieter Wuille 55913c9971 Merge pull request #1947 from centromere/freebsd_cpu_fix
Fixed 100% CPU utilization problem on FreeBSD 9
2012-10-24 02:15:54 -07:00
Wladimir J. van der Laan 4fbad9124e Fix out-of-bounds read noticed by Ricardo Correia
Sizeof() returned the size of a pointer instead of the size of the buffer.
Fixes issue #1924.
2012-10-24 08:26:50 +02:00
Gregory Maxwell faff50d129 Fixes a race condition in CreateNewBlock and a future null deref on testnet.
CreateNewBlock was reading pindexBest at the start before taking the lock
so it was possible to have the the block content not match the prevheader
and this can also trigger a newly added assert in ConnectBlock.

I noticed this during a code review after twobitcoins reported that ab91bf39
(BIP30 for all blocks) could cause a null dereference on a modified node
that mined during the IBD, or on testnet when it reached heights 91842 and
91880 due to CreateNewBlock calling ConnectBlock with pindex->phashBlock NULL.
2012-10-24 02:13:03 -04:00
Pieter Wuille 4afc0b5411 Bugfix: actually use CCoinsViewMemPool 2012-10-23 01:43:33 +02:00
Pieter Wuille c2ed184f98 Added some comments
Some clarifications after a code review by Mike Hearn.
2012-10-23 00:27:17 +02:00
Pieter Wuille 1e64c2d585 Bugfix: off-by-one in priority calculation 2012-10-23 00:23:39 +02:00
Pieter Wuille 9e957fb3b1 Bugfix: add missing fee check 2012-10-23 00:23:39 +02:00
Pieter Wuille 56424040a4 Bugfix: off-by-one error in coinbase maturity check 2012-10-23 00:23:39 +02:00
Alex 39ad0aa692 Fixed 100% CPU utilization problem on FreeBSD 9 2012-10-22 08:37:17 -04:00
Alex 17bfb1f437 Fixed compile error on FreeBSD 9.
See http://code.google.com/p/leveldb/issues/detail?id=98
2012-10-22 01:46:31 -04:00
Gregory Maxwell 2ef15697f8 Merge pull request #1939 from sipa/bugfix_zerobalance
Bugfix: do not mark all future coins spent
2012-10-21 16:20:04 -07:00
Philip Kaufmann 729b180686 change blockchain -> block chain (spelling)
- Wiki says "block chain" is correct ;)
- remove some unneeded spaces I found in the source, while fixing the spelling
2012-10-21 21:32:25 +02:00
Philip Kaufmann 039bcbf12d remove init messages from ThreadImport()
- remove uiInterface.InitMessage() calls from ThreadImport(), as Qt
  doesn't like them getting called out of it's main thread and because the
  thread will continue to run after the GUI was loaded
2012-10-21 21:16:52 +02:00
grimd34th 46936f343c Add NATIVE_WINDOWS
With a change of libs, and specifying NATIVE_WINDOWS as TARGET_OS it should compile libleveldb.a and libmemenv.a just fine, it did for me and Diapolo when testing.
2012-10-21 11:38:12 -03:00
Pieter Wuille 80fe60959d Tab instead of 4 spaces in makefile.mingw 2012-10-21 16:10:01 +02:00
Pieter Wuille ddba582377 Bugfix: do not mark all future coins spent 2012-10-21 15:19:19 +02:00
Gregory Maxwell d12b694106 Merge pull request #1938 from sipa/v0799
Update version numbers to 0.7.99
2012-10-21 03:12:25 -07:00
Pieter Wuille fcfa7a588e Update version numbers to 0.7.99 2012-10-21 12:10:08 +02:00
Gregory Maxwell 67e2c8a40a Merge pull request #1916 from jgarzik/caddrdb-bug
Fix: CAddrMan: verify pchMessageStart file marker, before reading address data
2012-10-20 15:06:25 -07:00
Pieter Wuille f50fb5470b Merge pull request #1936 from sipa/morehashwriter
Use CHashWriter also in SignatureHash(), and for message signing
2012-10-20 14:53:43 -07:00
Pieter Wuille 4ca60bba5c Remove BDB block database support 2012-10-20 23:08:57 +02:00
Pieter Wuille beeb57610c Add gettxout and gettxoutsetinfo RPCs 2012-10-20 23:08:57 +02:00
Pieter Wuille e1bfbab802 Add LevelDB MemEnv support
Support LevelDB memory-backed environments, and use them in unit tests.
2012-10-20 23:08:57 +02:00
Pieter Wuille 2d8a48292b LevelDB block and coin databases
Split off CBlockTreeDB and CCoinsViewDB into txdb-*.{cpp,h} files,
implemented by either LevelDB or BDB.

Based on code from earlier commits by Mike Hearn in his leveldb
branch.
2012-10-20 23:08:57 +02:00
Pieter Wuille 44d40f26dc Flush and sync block data 2012-10-20 23:08:57 +02:00
Pieter Wuille d979e6e36a Use singleton block tree database instance 2012-10-20 23:08:57 +02:00
Pieter Wuille 857c61df0b Prepare database format for multi-stage block processing
This commit adds a status field and a transaction counter to the block
indexes.
2012-10-20 23:08:57 +02:00
Pieter Wuille 4fea06db25 Automatically reorganize at startup to best known block
Given that the block tree database (chain.dat) and the active chain
database (coins.dat) are entirely separate now, it becomes legal to
swap one with another instance without affecting the other.

This commit introduces a check in the startup code that detects the
presence of a better chain in chain.dat that has not been activated
yet, and does so efficiently (in batch, while reusing the blk???.dat
files).
2012-10-20 23:08:57 +02:00
Pieter Wuille 13c51f20f6 Direct CCoins references
To prevent excessive copying of CCoins in and out of the CCoinsView
implementations, introduce a GetCoins() function in CCoinsViewCache
with returns a direct reference. The block validation and connection
logic is updated to require caching CCoinsViews, and exploits the
GetCoins() function heavily.
2012-10-20 23:08:57 +02:00
Pieter Wuille 64dd46fd05 Transaction hash caching
Use CBlock's vMerkleTree to cache transaction hashes, and pass them
along as argument in more function calls. During initial block download,
this results in every transaction's hash to be only computed once.
2012-10-20 23:08:57 +02:00
Pieter Wuille ae8bfd12da Batch block connection during IBD
During the initial block download (or -loadblock), delay connection
of new blocks a bit, and perform them in a single action. This reduces
the load on the database engine, as subsequent blocks often update an
earlier block's transaction already.
2012-10-20 23:08:57 +02:00
Pieter Wuille 450cbb0944 Ultraprune
This switches bitcoin's transaction/block verification logic to use a
"coin database", which contains all unredeemed transaction output scripts,
amounts and heights.

The name ultraprune comes from the fact that instead of a full transaction
index, we only (need to) keep an index with unspent outputs. For now, the
blocks themselves are kept as usual, although they are only necessary for
serving, rescanning and reorganizing.

The basic datastructures are CCoins (representing the coins of a single
transaction), and CCoinsView (representing a state of the coins database).
There are several implementations for CCoinsView. A dummy, one backed by
the coins database (coins.dat), one backed by the memory pool, and one
that adds a cache on top of it. FetchInputs, ConnectInputs, ConnectBlock,
DisconnectBlock, ... now operate on a generic CCoinsView.

The block switching logic now builds a single cached CCoinsView with
changes to be committed to the database before any changes are made.
This means no uncommitted changes are ever read from the database, and
should ease the transition to another database layer which does not
support transactions (but does support atomic writes), like LevelDB.

For the getrawtransaction() RPC call, access to a txid-to-disk index
would be preferable. As this index is not necessary or even useful
for any other part of the implementation, it is not provided. Instead,
getrawtransaction() uses the coin database to find the block height,
and then scans that block to find the requested transaction. This is
slow, but should suffice for debug purposes.
2012-10-20 23:08:57 +02:00
Pieter Wuille bba89aa82a Pre-allocate block and undo files in chunks
Introduce a AllocateFileRange() function in util, which wipes or
at least allocates a given range of a file. It can be overriden
by more efficient OS-dependent versions if necessary.

Block and undo files are now allocated in chunks of 16 and 1 MiB,
respectively.
2012-10-20 23:08:57 +02:00
Pieter Wuille 5382bcf8cd Multiple blocks per file
Change the block storage layer again, this time with multiple files
per block, but tracked by txindex.dat database entries. The file
format is exactly the same as the earlier blk00001.dat, but with
smaller files (128 MiB for now).

The database entries track how many bytes each block file already
uses, how many blocks are in it, which range of heights is present
and which range of dates.
2012-10-20 23:08:57 +02:00
Pieter Wuille 8adf48dc9b Preliminary undo file creation
Create files (one per block) with undo information for the transactions
in it.
2012-10-20 23:08:57 +02:00
Pieter Wuille 630fd8dcb6 One file per block
Refactor of the block storage code, which now stores one file per block.
This will allow easier pruning, as blocks can be removed individually.
2012-10-20 23:08:57 +02:00
Pieter Wuille 44ac1c0fe3 Add CTxUndo: transaction undo information
The CTxUndo class encapsulates data necessary to undo the effects of
a transaction on the txout set, namely the previous outputs consumed
by it (script + amount), and potentially transaction meta-data when
it is spent entirely.
2012-10-20 23:08:56 +02:00
Pieter Wuille 10fd8604d7 Add CCoins: pruned list of transaction outputs
The CCoins class represents a pruned set of transaction outputs from
a given transaction. It only retains information about its height in
the block chain, whether it was a coinbase transaction, and its
unspent outputs (script + amount).

It has a custom serializer that has very low redundancy.
2012-10-20 23:08:56 +02:00
Pieter Wuille 0fa593d0fb Compact serialization for amounts
Special serializer/deserializer for amount values. It is optimized for
values which have few non-zero digits in decimal representation. Most
amounts currently in the txout set take only 1 or 2 bytes to
represent.
2012-10-20 23:08:56 +02:00
Pieter Wuille 69fc8047a9 Compact serialization for scripts
Special serializers for script which detect common cases and encode
them much more efficiently. 3 special cases are defined:
* Pay to pubkey hash (encoded as 21 bytes)
* Pay to script hash (encoded as 21 bytes)
* Pay to pubkey starting with 0x02, 0x03 or 0x04 (encoded as 33 bytes)

Other scripts up to 121 bytes require 1 byte + script length. Above
that, scripts up to 16505 bytes require 2 bytes + script length.
2012-10-20 23:08:56 +02:00
Pieter Wuille 4d6144f97f Compact serialization for variable-length integers
Variable-length integers: bytes are a MSB base-128 encoding of the number.
The high bit in each byte signifies whether another digit follows. To make
the encoding is one-to-one, one is subtracted from all but the last digit.
Thus, the byte sequence a[] with length len, where all but the last byte
has bit 128 set, encodes the number:

  (a[len-1] & 0x7F) + sum(i=1..len-1, 128^i*((a[len-i-1] & 0x7F)+1))

Properties:
* Very small (0-127: 1 byte, 128-16511: 2 bytes, 16512-2113663: 3 bytes)
* Every integer has exactly one encoding
* Encoding does not depend on size of original integer type
2012-10-20 23:08:56 +02:00
Pieter Wuille 43b7905e98 LevelDB glue
Database-independent glue for supporting LevelDB databases.

Based on code from earlier commits by Mike Hearn in his leveldb
branch.
2012-10-20 23:08:56 +02:00
Pieter Wuille 3ff3a2bd60 Makefile integration of LevelDB 2012-10-20 23:08:56 +02:00
Pieter Wuille 9f56678fce Backport Win32 LevelDB env from C++0x to C++
Since the gitian mingw compiler doesn't support C++0x yet.
2012-10-20 23:08:56 +02:00
Pieter Wuille 9d503a7285 Disable libsnappy detection in LevelDB 2012-10-20 23:08:56 +02:00
justmoon 94a50fb339 Leveldb Windows port by Edouard Alligand, adapted for MingW by me. 2012-10-20 23:08:56 +02:00
Mike Hearn 5e650d6d2d Import LevelDB 1.5, it will be used for the transaction database. 2012-10-20 23:08:56 +02:00
Jeff Garzik 38ac953b9d Merge pull request #1880 from sipa/threadimport
Move external block import to separate thread
2012-10-20 13:36:36 -07:00
Jeff Garzik dee0ee2ac9 Merge pull request #1742 from sipa/canonical
Check for canonical public keys and signatures
2012-10-20 10:56:04 -07:00
Pieter Wuille 66b02c93e6 Move external block import to separate thread 2012-10-20 01:54:10 +02:00
Pieter Wuille 8980a50924 Use CHashWriter also in SignatureHash(), and for message signing 2012-10-19 23:18:07 +02:00
Wladimir J. van der Laan 485d667748 Revert "Merge pull request #1931 from laanwj/2012_10_newicons"
This reverts commit 199d88cf90, reversing
changes made to 65bc1573e7.

License is worse instead of better. Will only accept public domain and
MIT-licensed icons from now on.
2012-10-14 20:49:06 +02:00
xanatos cddda5d9f0 Changed connect?_16.png to non-GPL one and changed the assets attribution. 2012-10-14 13:01:38 +02:00
xanatos b96238a9c9 Changed the spinner to a non-GPL one, added instructions on how to regenerate it, changed the assets attribution, removed old spinner + old spinner's sources. 2012-10-14 12:34:07 +02:00
Philip Kaufmann 34710818a7 Bitcoin-Qt: intregrate current translations from Transifex 2012-10-12 15:51:49 +02:00
Philip Kaufmann 0e005c3ddc Bitcoin-Qt: update english translation master file 2012-10-12 15:45:27 +02:00
Wladimir J. van der Laan 22bb049011 Fix a use-after-free problem in initialization (#1920)
Don't store the result of c_str().

Luckily, this only affects logging, though it could crash or leak
sensitive data to the log in rare cases.
2012-10-12 03:09:05 +02:00
Wladimir J. van der Laan 16f3618c13 Merge pull request #1879 from sipa/fdatasync
Use fdatasync instead of fsync on supported platforms
2012-10-11 00:42:47 -07:00
Wladimir J. van der Laan 24694e24ed Merge pull request #1913 from sipa/noi2p
Remove I2P support from netbase
2012-10-11 00:41:33 -07:00
Wladimir J. van der Laan fae3989ffc Merge pull request #1900 from Diapolo/optionsmodel_getters
move most explicit getters in optionsmodel to header
2012-10-11 00:40:20 -07:00
Wladimir J. van der Laan 089b10a28a Merge pull request #1911 from Diapolo/fix_signed_unsigned
fix wrong (signed/unsigned) printf format specifier in bitcoinrpc.cpp
2012-10-11 00:40:08 -07:00
Wladimir J. van der Laan ac0ad5dc63 Merge pull request #1901 from laanwj/2012_10_remove_strlcpy
get rid of strlcpy.h
2012-10-11 00:39:51 -07:00
Gavin Andresen 1d1f32d16d Bump versions for 0.7.1 release 2012-10-09 12:37:35 -04:00
Gavin Andresen de038acd96 Fix bad merge, pszDataDir duplication 2012-10-09 12:28:00 -04:00
Gavin Andresen 673021410f Merge branch 'wallet_exceptions' of github.com:gavinandresen/bitcoin-git 2012-10-09 12:14:26 -04:00
Gavin Andresen cf64347d70 Merge branch 'crash_at_exit' of github.com:gavinandresen/bitcoin-git 2012-10-09 12:10:18 -04:00
Wladimir J. van der Laan 0a5ce30bc1 Merge pull request #1915 from Diapolo/Qt5_compat_leftover
change Q_WS_MAC -> Q_OS_MAC (Qt5 compatibility)
2012-10-08 22:28:24 -07:00
Jeff Garzik de2b9459bd Merge pull request #1834 from jgarzik/kickblocks
P2P: Do not request blocks from peers with fewer blocks than us
2012-10-08 15:15:58 -07:00
Jeff Garzik b855abb8db Revert "Send 'mempool' P2P command at the start of each P2P session"
Fat-fingered on github, and merged this too early.

This reverts commit 22f9b06903.
2012-10-08 18:14:15 -04:00
Jeff Garzik 56caa38a67 Merge pull request #1833 from jgarzik/mempool-query
Send 'mempool' P2P command at the start of each P2P session
2012-10-08 15:12:25 -07:00
Gavin Andresen d0b3e77a08 Don't try to verify a non-existent wallet.dat 2012-10-08 17:46:46 -04:00
Gavin Andresen eed1785f70 Handle corrupt wallets gracefully.
Corrupt wallets used to cause a DB_RUNRECOVERY uncaught exception and a
crash. This commit does three things:

1) Runs a BDB verify early in the startup process, and if there is a
low-level problem with the database:
  + Moves the bad wallet.dat to wallet.timestamp.bak
  + Runs a 'salvage' operation to get key/value pairs, and
    writes them to a new wallet.dat
  + Continues with startup.

2) Much more tolerant of serialization errors. All errors in deserialization
are reported by tolerated EXCEPT for errors related to reading keypairs
or master key records-- those are reported and then shut down, so the user
can get help (or recover from a backup).

3) Adds a new -salvagewallet option, which:
 + Moves the wallet.dat to wallet.timestamp.bak
 + extracts ONLY keypairs and master keys into a new wallet.dat
 + soft-sets -rescan, to recreate transaction history

This was tested by randomly corrupting testnet wallets using a little
python script I wrote (https://gist.github.com/3812689)
2012-10-08 17:46:45 -04:00
Gavin Andresen 8d5f461cb6 Handle incompatible BDB environments
Before, opening a -datadir that was created with a new
version of Berkeley DB would result in an un-caught DB_RUNRECOVERY
exception.

After these changes, the error is caught and the user is told
that there is a problem and is told how to try to recover from
it.
2012-10-08 17:25:17 -04:00
Gavin Andresen c2bb42168b Merge branch 'BDB_DOWNGRADE' 2012-10-08 17:18:17 -04:00
Gavin Andresen e4954b1297 Handle incompatible BDB environments
Before, opening a -datadir that was created with a new
version of Berkeley DB would result in an un-caught DB_RUNRECOVERY
exception.

After these changes, the error is caught and the user is told
that there is a problem and is told how to try to recover from
it.
2012-10-08 15:51:59 -04:00
Jeff Garzik bd2e140571 CAddrMan: verify pchMessageStart file marker, before reading address data
This avoids the case where you read the address data, before noticing it is
the wrong network.
2012-10-08 13:41:57 -04:00
Philip Kaufmann ada2a39691 change Q_WS_MAC -> Q_OS_MAC (Qt5 compatibility)
- I missed that one in my former pull
2012-10-07 18:50:03 +02:00
Philip Kaufmann 5e5c102f2f make optionsmodel query real proxy state for ::data()
- don't rely on the QSettings for cases ProxyUse and ProxySocksVersion and
  query the real values via the GetProxy() call
- add a missing "succesful =" for case ProxyUse in ::setData()
2012-10-07 17:59:41 +02:00
Pieter Wuille 43de64949c Merge pull request #1859 from Diapolo/proxy_locks
add LOCK() for proxy related data-structures
2012-10-07 07:03:06 -07:00
Pieter Wuille e996521390 Use fdatasync instead of fsync on supported platforms 2012-10-07 15:51:40 +02:00
Pieter Wuille 4e882b7960 Remove I2P support from netbase
I2P apparently needs 256 bits to store a fully routable address. Garlicat
requires a centralized lookup service to map the 80-bit addresses to fully
routable ones (as far as I understood), so that's not really usable in our
situation.

To support I2P routing and peer exchange for it, another solution is needed.
This will most likely imply a network protocol change, and extension of the
'addr' message.
2012-10-07 15:10:14 +02:00
Wladimir J. van der Laan 6032e4f4e7 get rid of strlcpy.h
Don't use hand-rolled string manipulation routine with a fixed
buffer in the bitcoin core, instead make use of c++ strings and boost.
2012-10-07 14:38:37 +02:00
Philip Kaufmann 95e625d235 fix wrong (signed/unsigned) printf format specifier in bitcoinrpc.cpp
- also includes the required bitcoinstrings.cpp update
2012-10-05 23:31:58 +02:00
Wladimir J. van der Laan ee0b648536 Merge pull request #1906 from laanwj/2012_10_help_stdout
Send --help message to stdout i.s.o stderr
2012-10-05 11:24:09 -07:00
Wladimir J. van der Laan a6be58d536 Merge pull request #1905 from laanwj/2012_10_startup_gui_error
When datadir missing, show messagebox instead of printing error to stderr
2012-10-04 22:28:44 -07:00
Pieter Wuille 39930ca6ae Merge pull request #1908 from laanwj/2012_10_rpcerrors
Document RPC error codes
2012-10-04 17:17:53 -07:00
Gavin Andresen cac6b389d1 Avoid crashes at shutdown due to printf() in global destructors. 2012-10-04 16:35:08 -04:00
Wladimir J. van der Laan 285746d3db Add constants for HTTP status codes 2012-10-04 15:49:15 +02:00
Wladimir J. van der Laan 738835d7b8 Document RPC error codes
Replace all "magic values" in RPCError(...) by constants.
2012-10-04 15:49:15 +02:00
Wladimir J. van der Laan 61fd72695f When datadir missing, show messagebox instead of printing error to stderr 2012-10-04 12:04:12 +02:00
Philip Kaufmann 81bbef2609 add LOCK() for proxy related data-structures
- fix #1560 by properly locking proxy related data-structures
- update GetProxy() and introduce GetNameProxy() to be able to use a
  thread-safe local copy from proxyInfo and nameproxyInfo
- update usage of GetProxy() all over the source to match the new
  behaviour, as it now fills a full proxyType object
- rename GetNameProxy() into HaveNameProxy() to be more clear
2012-10-04 09:35:24 +02:00
Wladimir J. van der Laan 366944431b Pull changed translations from transifex
There was also a new translation available, "ja" (Japanese), however
almost nothing was filled in yet, so I'm not including it for this release.
2012-10-04 08:18:12 +02:00
Wladimir J. van der Laan f1e262c8e1 Translation update for 0.7.1
Also clarify translation process that the package `gettext` is needed to run string extractor.
2012-10-04 08:13:37 +02:00
Wladimir J. van der Laan bb353618f1 Send --help message to stdout i.s.o stderr
This allows fun stuff such as `bitcoin --help | less`, and more
easy piping to files.

Looking at other tools such as bash, gcc, they all send their help
text to stdout.
2012-10-04 07:56:57 +02:00
Wladimir J. van der Laan 529a4d4824 remove "checkorder" and "reply" P2P commands
These command are a leftover from send-to-IP transactions, which have been
removed a long time ago.
Also removes CNode::mapRequests and CNode::PushRequests, as these were
only used for the mentioned commands.
2012-10-03 20:09:33 +02:00
Philip Kaufmann 7bc65ff108 move most explicit getters in optionsmodel to header
- is more consistent and saves quite some lines of code
2012-10-02 18:49:57 +02:00
Gavin Andresen 0547b02af7 Merge branch '2012_09_fixwformat' of github.com:laanwj/bitcoin 2012-10-01 16:52:42 -04:00
Gavin Andresen d2cc6f489c Merge branch 'master' of github.com:runeksvendsen/bitcoin 2012-10-01 16:51:24 -04:00
Gavin Andresen da6e9fe634 Merge pull request #1893 from kjj2/issue1884
Issue 1884: Add a backup warning to the encryptwallet RPC command
2012-10-01 13:40:48 -07:00
Wladimir J. van der Laan 827d8c2e0c Revert "Remove -Wformat* warnings from makefiles"
This reverts commit 14ac0adcc7.
2012-10-01 19:45:42 +02:00
Philip Kaufmann d210f4f5b8 fix -Wformat warnings all over the source 2012-10-01 19:45:42 +02:00
Wladimir J. van der Laan bcc292b22d Extend printf warnings to error() 2012-10-01 19:45:41 +02:00
Gavin Andresen 00a757375c Merge branch '2012_09_base58tests' of github.com:laanwj/bitcoin 2012-10-01 11:22:38 -04:00
Wladimir J. van der Laan d6b13283d1 data-driven base58 CBitcoinAddress/CBitcoinSecret tests
Arbitrary numbers of test vectors can be generated using the script
`gen_base58_test_vectors.py`.
2012-10-01 04:57:26 +02:00
Rune K. Svendsen 1bf66fcc0a When encrypting the wallet, warn user that old backups will become useless.
Don't include HTML in translation strings. Do split the huge message over several lines.

Prettier lines
2012-09-30 15:57:53 +02:00
kjj2 31a8b70ee3 Add a backup warning to the encryptwallet RPC command 2012-09-30 08:50:59 -05:00
Philip Kaufmann 9c8dc7caf1 harmonize printf format characters
- remove the "%" character from format characters for (s)size_t and
  ptrdiff_t and harmonize them with the ones for int64 and uint64
2012-09-30 11:57:25 +02:00
Wladimir J. van der Laan 018ec85ff7 Merge pull request #1875 from hsoft/master
Fix compilation with clang under OS X
2012-09-29 02:23:46 -07:00
Wladimir J. van der Laan f72fd0e792 Merge pull request #1881 from xanatos/Tests
Removed a duplicated identical if
2012-09-29 01:00:55 -07:00
Wladimir J. van der Laan 552af52b45 Merge pull request #1851 from fanquake/OpenSSL-1.0.1c
Update to use OpenSSL 1.0.1c
2012-09-29 00:58:15 -07:00
Wladimir J. van der Laan 3b2eb49db9 Merge pull request #1883 from sipa/norandstack
Remove stack randomization
2012-09-29 00:56:25 -07:00
Jeff Garzik 3e37e7eca4 Merge pull request #1871 from jgarzik/wallet-deadcode
walletdb.h: remove dead code
2012-09-28 17:05:16 -07:00
Pieter Wuille 2e3ffb2d82 Remove stack randomization 2012-09-28 21:53:28 +02:00
Pieter Wuille 842a31ad1b Merge pull request #1862 from kjj2/testports
Fix: when testnet=1 specified, change default RPC port to 18332
2012-09-28 08:03:45 -07:00
xanatos 50e01ee620 toHTML won't add empty wtx.mapValue elements
As the code was before, toHTML added empty elements to mapValue to check for their existance. Now first it check for their existance and then for their non-emptiness.

Removed a duplicated identical if

There are two equal ifs, one inside another. If the first one is true, then the second one is true.
2012-09-28 15:50:48 +02:00
Wladimir J. van der Laan 035cb4781d Merge pull request #1868 from maaku/and_or_xor_sign_extension
Documented bug in sign-extension behavior of opcodes OP_AND, OP_OR, and OP_XOR
2012-09-27 22:48:27 -07:00
Virgil Dupras fee10d800e Fixed compilation error with clang.
Previously, trying to compile with clang would result in the error: assigning to 'objc_object *' from incompatible type 'DockIconClickEventHandler *'
2012-09-27 15:06:16 -04:00
Wladimir J. van der Laan 14ac0adcc7 Remove -Wformat* warnings from makefiles
commit 5a1a3622 effectively enabled these warnings, but they need
to be fixed before being enabled in the general build scripts.
2012-09-27 04:10:21 +02:00
Jeff Garzik 189eb6a989 walletdb.h: remove dead code 2012-09-26 21:56:45 -04:00
Wladimir J. van der Laan 5a1a362215 Merge pull request #1807 from laanwj/2012_09_printf_warnings
Add printf-style warnings to strprintf() and OutputDebugStringF()
2012-09-25 22:56:29 -07:00
Mark Friedenbach 95d7f00295 Documented bug in sign-extension behavior of opcodes OP_AND, OP_OR, and OP_XOR.
Due to a bug in the implementation of MakeSameSize(), using OP_AND, OP_OR, or OP_XOR with signed values of unequal size will result in the sign-value becoming part of the smaller integer, with nonsensical results. This patch documents the unexpected behavior and provides the basis of a solution should decision be made to fix the bug in the future.
2012-09-25 16:40:34 -07:00
Jeff Garzik 1381ad2b21 Merge pull request #1684 from jgarzik/bootstrap
Import $DataDir/bootstrap.dat automatically, if it exists.
2012-09-25 13:53:40 -07:00
Wladimir J. van der Laan 4d369ec30c Update comment, we're no longer using boost::interprocess::scoped_lock 2012-09-25 12:16:37 +02:00
Wladimir J. van der Laan 1a52dd10a7 Merge pull request #1854 from Diapolo/fix_1843_V2
additional fix for #1843
2012-09-25 01:35:22 -07:00
kjj2 b202d43076 Fix: when testnet=1 specified, change default ports to 18332 and 18333 2012-09-24 15:26:04 -05:00
Jeff Garzik 22f9b06903 Send 'mempool' P2P command at the start of each P2P session
to query remote node mempool contents.
2012-09-24 13:53:44 -04:00
Jeff Garzik 52c90a2b2b Import $DataDir/bootstrap.dat automatically, if it exists.
As discussed on IRC. Intended to make using an external blockchain download
solution just a bit easier.
2012-09-24 13:37:03 -04:00
Jeff Garzik 93dd68e924 P2P: Do not request blocks from peers with fewer blocks than us
If the remote node has a shorter chain, do not waste our
special getblocks request on them.
2012-09-24 13:26:09 -04:00
Wladimir J. van der Laan feec18e329 Merge pull request #1836 from kjj2/stopdetach
Adds a stopdetach <detach> RPC command.  <detach> defaults to true.  Wor...
2012-09-23 05:49:42 -07:00
Wladimir J. van der Laan 49b09ec04f Merge pull request #1853 from fanquake/qt-include
Update include for Qt5
2012-09-23 05:35:24 -07:00
kjj2 3731f5788e Adds a stopdetach <detach> RPC command. <detach> defaults to true. Works just like stop, but overrides the commandline/config file
-detachdb option.  Useful for upgrading, for example.  Lets you use fast stops usually, but force a detach when needed.  Also, allows
you to do a fast stop in a system normally configured for fast stops.
2012-09-22 18:17:29 -05:00
fanquake ea9eaf9dec Update Qt include
Update Qmenu include

This is to be more consistent with the rest of the source

Update Qt Includes
2012-09-22 18:56:22 +08:00
Wladimir J. van der Laan 2f91373a0a Merge pull request #1852 from fanquake/bugreportlinks
Update links to Qt
2012-09-22 03:29:46 -07:00
Philip Kaufmann bb86cffa56 additional fix for #1843
- a shortcut on "receive coins" was used twice
2012-09-22 12:15:41 +02:00
fanquake e1eb3d4451 Update Bugreport Links
Update Qt Links

Revert Qt source link

Update Qt links
2012-09-22 18:05:25 +08:00
Wladimir J. van der Laan f394f21594 Merge pull request #1844 from Diapolo/Qt5_compat1
enhance Qt5 compatibility
2012-09-22 02:21:06 -07:00
fanquake 0eaaa83ba5 Update Bitcoin to use OpenSSL 1.0.1c
Bump deps tp 0.0.5
Small docs corrections
2012-09-22 14:51:03 +08:00
Wladimir J. van der Laan 38682648c2 Remove unnecessary text from tooltip in AddressBookPage 2012-09-22 08:37:56 +02:00
Philip Kaufmann da9413d913 fix #1843 by changing 2 GUI shortcuts 2012-09-21 19:31:53 +02:00
Philip Kaufmann 81605d90f5 enhance Qt5 compatibility
- replace Q_WS_MAC (not supported anymore in Qt5) with Q_OS_MAC (supported
  in Qt4/5)
2012-09-21 19:06:53 +02:00
Wladimir J. van der Laan e96a8c7d86 Merge pull request #1793 from Diapolo/fix_signed_unsigned_strprintf
fix signed/unsigned in strprintf and CNetAddr::GetByte()
2012-09-21 06:04:27 -07:00
Wladimir J. van der Laan 3ccbaa56f4 comment update: it's -> its 2012-09-21 14:15:26 +02:00
Wladimir J. van der Laan 1ba4925755 Merge pull request #1705 from Diapolo/cleanup_bitcoingui
Qt: re-order GUI code and remove FIRST_CLASS_MESSAGING
2012-09-20 23:08:52 -07:00
Wladimir J. van der Laan 2dca98511f Merge pull request #1810 from laanwj/2012_09_rpcconsole_eventfilter
Improve RPC console key event behaviour
2012-09-20 23:02:52 -07:00
Pieter Wuille 58bc86e37f Check for canonical public keys and signatures
Only enabled inside tests for now.
2012-09-21 01:24:25 +02:00
Gavin Andresen f2b066da70 Update gitignore and Makefiles for build.h move from src/ to src/obj 2012-09-20 10:28:13 -04:00
Wladimir J. van der Laan bfc24bd4ce Merge pull request #1717 from Diapolo/Qt_change_TX_display
Qt: show mined transactions at depth 1
2012-09-20 00:42:31 -07:00
Gavin Andresen 6cbae37667 Merge branch 'testdata' of git://github.com/TheBlueMatt/bitcoin 2012-09-18 19:22:40 -04:00
Jeff Garzik b1d3e95a0a When rejected TX relay due to lack of fees, log full txid 2012-09-18 15:24:31 -04:00
Jeff Garzik ea0796bde3 Trim trailing whitespace for src/*.{h,cpp} 2012-09-18 15:07:58 -04:00
Gavin Andresen 8b371316c5 Merge branch 'master' of github.com:bitcoin/bitcoin 2012-09-18 12:20:01 -04:00
Gavin Andresen 8f09e4cac4 Give makefiles 'test' and 'check' targets to compile and run unit tests 2012-09-18 12:18:51 -04:00
Jeff Garzik f8c449b5c8 Merge pull request #1812 from jgarzik/misc-07
Two minor generic cleanups done during OP_DROP hacking
2012-09-18 09:14:53 -07:00
Gavin Andresen a0971337d0 Merge branch 'refactor_times' of git://github.com/luke-jr/bitcoin 2012-09-18 10:59:31 -04:00
Gavin Andresen 5add0b0d0f Bump client version to 0.7.0.99 now that 0.7.0 release is final. 2012-09-18 10:58:22 -04:00
Christian von Roques 48a10a3780 reimplement CBigNum's compact encoding of difficulty targets
Use shifts instead of going through the MPI representation of BIGNUMs.
Be careful to keep the meaning of 0x00800000 as sign bit.
2012-09-17 15:37:19 +02:00
Christian von Roques 6f0cecfc47 tests for SetCompact and GetCompact of CBigNum 2012-09-15 19:08:50 +02:00
Wladimir J. van der Laan 7fddf1210e update comment, secure_allocator is defined in allocators.h 2012-09-15 12:10:00 +02:00
Philip Kaufmann 463a1cab43 fix signed/unsigned in strprintf and CNetAddr::GetByte()
- I checked every occurance of strprintf() in the code and used %u, where
  unsigned vars are used
- the change to GetByte() was made, as ip is an unsigned char
2012-09-12 21:30:47 +02:00
Gavin Andresen 0a4e67afad Bump client version number for 0.7.0rc3 2012-09-12 14:07:22 -04:00
Pieter Wuille c1d79812f4 Do not abort if RPC listening for IPv6 fails
Instead, fall back to IPv4 listening.
2012-09-12 16:45:09 +02:00
Wladimir J. van der Laan 3b3d999618 Add format characters for (s)size_t and ptrdiff_t 2012-09-10 04:25:26 +02:00
Wladimir J. van der Laan ac4e7f6269 HexStr: don't build a vector<char> first
Also const correctness for lookup tables in hex functions throughout the code.
2012-09-10 04:24:57 +02:00
Gregory Maxwell ab91bf39b7 Apply BIP30 checks to all blocks except the two historic violations.
Matt pointed out some time ago that there existed a minor DOS
attack where a node in its initial block download could be wedged
by an overwrite attack in a fork created between checkpoints before
a time where BIP30 was enforced. Now that the BIP30 timestamp
is irreversibly past the check can be more aggressive and apply to
all blocks except the two historic violations.
2012-09-09 20:11:04 -04:00
Jeff Garzik 17f8d6e400 Improve debug logging, for mempool TXs that do not include sufficient fees 2012-09-09 17:05:26 -04:00
Jeff Garzik 76970091f1 Cosmetic: move CTransaction::GetMinFee out of header file 2012-09-09 17:01:18 -04:00
Wladimir J. van der Laan 62904b33f3 Improve RPC console key event behaviour
- Paging using PageUp / PageDown now works when entry widget has focus
- Typing or pasting while the messages widget has focus auto-selects entry widget
2012-09-09 20:44:59 +02:00
Wladimir J. van der Laan b019ea17ec Remove VC6 comment and pointless #ifdef'd benchmark code
We're in a wholly different world now, C++-compiler-wise.

Current std::stringstream implementations don't have the stated problem anymore,
and are just as fast as CDataStream.

The #ifdef'd block does not even compile anymore; CDataStream constructor changed,
and missing some std::. Also timing in whole seconds is also way too granular
to say anything sensible in such microbenchmarks. Just remove it,
it can always be found again in git history.
2012-09-09 17:24:00 +02:00
Wladimir J. van der Laan 963af6449f Cleanup some unused macros from util.h
Encapsulate _snprintf/sprintf difference in implementation not header
2012-09-09 15:47:29 +02:00
Wladimir J. van der Laan b0a90fbb0c Add printf-style warnings to strprintf() and OutputDebugStringF()
This finds about ~150 potential problems with format characters on a 64 bit build.
2012-09-09 14:47:31 +02:00
Wladimir J. van der Laan d8ecd21ff7 Merge pull request #1802 from luke-jr/bugfix_ts
Update translations from Transifex (100% coverage for Finnish and Chinese (China)
2012-09-09 00:04:03 -07:00
Luke Dashjr 85eb1e7e56 Update translations from Transifex (100% coverage for Finnish and Chinese (China) 2012-09-08 20:32:54 +00:00
Wladimir J. van der Laan 31fac119dc Merge pull request #1796 from luke-jr/bugfix_ts
Various translation fixups and restorations
2012-09-07 22:15:19 -07:00
Luke Dashjr 4ee706243c Partially Bugfix: Update English translation strings and translations from Transifex
Bugfix: Correct doubled-up &amp;amp; in translations
Bugfix: Remove extra spaces after ampersand in translations (this fixes hotkeys)
Restore copyright translations, now split up
Restore old translations lost due to changes to English structure
	Skipped: ca_ES et eu_ES fr_CA (under 10% coverage)
2012-09-08 04:59:13 +00:00
Luke Dashjr da7b8c1260 Bugfix: Initialize CWallet::nOrderPosNext on an empty wallet, and save it in db 2012-09-08 04:55:36 +00:00
Wladimir J. van der Laan db1967957d Merge pull request #1798 from xanatos/patch-19
Wrong address added to collection in test (address1 instead of address2)
2012-09-07 07:13:23 -07:00
Philip Kaufmann f875921176 Bitcoin-Qt (Windows only): add version info to Resource File
- add version information to bitcoin-qt.rc, which is displayed on Windows, when looking in the executable properties and selecting "Details"
- introduce a new clientversion.h (used in bitcoin-qt.rc to generate
  version information), which takes only the version defines from
  version.h and is included in it (to allow usage with the windres rc-file
  compiler)
- move #define STRINGIFY(s) #s into clientversion.h as that is used in
  bitcoin-qt.rc and rename to DO_STRINGIZE(X)
- add #define STRINGIZE(X) DO_STRINGIZE(X), which is needed to convert the
  version defines into a version string in the rc-file
- this ensures we only need to update 1 file and have bitcoin-qt.exe
  version information

- for RC-file documentation see:
  http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058%28v=vs.85%29.aspx
2012-09-07 16:08:18 +02:00
xanatos af8c050bff Wrong address added to collection in test
The wrong address is added to the collection. As was written a second copy of address1 was added (and so address2 was useless).
2012-09-07 16:04:39 +03:00
Wladimir J. van der Laan f106491fa2 Merge pull request #1786 from jgarzik/select-fix
select()'s first argument should be zero, if no file descriptors are selected
2012-09-06 23:30:22 -07:00
Gavin Andresen 1913b6e2fc Fix double-paren typo 2012-09-06 16:29:59 -04:00
Matt Corallo 65786afb05 Add various tests for CTransaction::CheckTransaction() 2012-09-05 22:33:59 -04:00
Matt Corallo 1fcebc16c5 check tx.CheckTransaction for data-driven tx tests.
(and change so that only one case has to fail to make a tx_invalid
test correct)
2012-09-05 22:33:59 -04:00
Philip Kaufmann 4bd34b4966 replace 2x WSAGetLastError() with 1x WSAGetLastError() call 2012-09-05 22:20:26 +02:00
Jeff Garzik 2387944782 select(): Use precise fd presence check, rather than imprecise hSocketMax test 2012-09-05 16:01:28 -04:00
Gavin Andresen 8788221761 Bump version number for 0.7.0rc2 2012-09-05 12:38:37 -04:00
Gavin Andresen 91c218a1cb Merge branch 'testnet_alert' of git://github.com/gavinandresen/bitcoin-git 2012-09-05 11:38:38 -04:00
xanatos 4f76be1dc5 Correct LoadWallet() return value (false -> DB_LOAD_OK)
Equivalent code. (false == 0 == DB_LOAD_OK). Fixes #1706.
2012-09-05 11:32:13 +03:00
Jeff Garzik e271c1d3d0 Merge pull request #1789 from Diapolo/fix_double_Startuptime
remove double logging of startup time, when !fLogTimestamps
2012-09-04 23:39:15 -07:00
Philip Kaufmann 274b7ab123 remove double logging of startup time, when !fLogTimestamps 2012-09-05 08:36:50 +02:00
Philip Kaufmann 8d367c7e66 fix signed/unsigned usage in BlockFilePath() 2012-09-05 08:34:41 +02:00
Jeff Garzik 42613c97d5 Add block file naming helper, BlockFilePath() 2012-09-04 21:40:26 -04:00
Jeff Garzik dcb14198bb init.cpp: fix build error, and possibly-uninit'd warning 2012-09-04 12:24:08 -04:00
Jeff Garzik 38e8f282d2 Merge pull request #1427 from rebroad/StartTimeFix
No need to log start time if it's already being done on every line.
2012-09-04 09:10:47 -07:00
Jeff Garzik 2fd6f067db Merge pull request #1777 from laanwj/2012_09_eliminate_sprintf
Remove last occurrence of potentially insecure function sprintf
2012-09-04 09:00:02 -07:00
Jeff Garzik bec02998b4 Merge pull request #1779 from xanatos/patch-15
Useless vector declaration
2012-09-04 08:59:05 -07:00
Jeff Garzik 8c7b6c05db Merge pull request #1738 from laanwj/2012_08_boostthread
implement CreateThread with boost::thread
2012-09-04 08:53:05 -07:00
Wladimir J. van der Laan 9d7da11458 Merge pull request #1743 from xanatos/patch-14
Changed nprev->pprev
2012-09-03 08:11:36 -07:00
Wladimir J. van der Laan acbe4a1f32 Merge pull request #1728 from xanatos/patch-11
Removed duplicated lock
2012-09-03 08:00:18 -07:00
xanatos 89fbd1f11c Useless vector declaration
The vector isn't referenced in the small code block it's declared. I don't see any "useful" side effect in its declaration.
2012-09-03 17:53:27 +03:00
Wladimir J. van der Laan 9c80909452 Remove last occurrence of potentially insecure function sprintf.
%d can return up to 11 characters. Move away from fixed buffer completely and
use our own safe function strprintf.
2012-09-03 16:18:16 +02:00
Gavin Andresen eaf00a3a5d Merge pull request #1774 from luke-jr/refactor_times
Bugfix: Require OrderedTxItems to provide properly scoped accounting entry list
2012-09-02 16:47:58 -07:00
Wladimir J. van der Laan 4d0c2b6cf4 Merge pull request #1761 from Diapolo/timeout_desc
add default value in -timeout description
2012-09-02 06:19:10 -07:00
Philip Kaufmann af7b88f29f clear history when using clear button in RPC console
- current code does not clear history, when using the clear button, this
  is added
- remove a currently unused variable but add a TODO comment
2012-09-02 13:18:34 +02:00
Luke Dashjr ddb709e9de Bugfix: Require OrderedTxItems to provide properly scoped accounting entry list
OrderedTxItems returns a multimap of pointers, but needs a place to store the actual CAccountingEntries it points to.
It had been using a stack item, which was clobbered as soon as it returned, resulting in undefined behaviour.
This fixes at least bug #1768.
2012-09-02 08:02:46 +00:00
Jeff Garzik 0e1be81a4a Merge pull request #1771 from luke-jr/bugfix_bip22_mode
Bugfix: getblocktemplate: Accept optional "mode" parameter not being provided
2012-09-01 12:30:13 -07:00
R E Broadley 016178132e No need to log start time if it's already being done on every line. 2012-09-01 14:24:33 +01:00
Luke Dashjr 0689a7eb9c Bugfix: getblocktemplate: Accept optional "mode" parameter not being provided 2012-09-01 07:12:56 +00:00
Wladimir J. van der Laan 9c94bdac06 RPC console: escaping within ' and " now handled differently
Should now mimic bash quoting and escaping (see http://wiki.bash-hackers.org/syntax/quoting) exactly,
leaving out argument expansion and obscure syntax like $''.
2012-09-01 09:08:38 +02:00
Gregory Maxwell ddbddcb31e Merge pull request #1758 from laanwj/2012_08_uiconsole_parsing
Fix RPC console parser to handle escaped arguments more like bash
2012-08-31 22:50:23 -07:00
Wladimir J. van der Laan b5c1467a7d In RPC console, attempt to format errors
Try to display a nicer message instead of dumping raw JSON object when possible. If the error
somehow doesn't have the required 'code' and 'message' fields, fall back to printing raw JSON object.
2012-08-31 17:41:58 +02:00
Wladimir J. van der Laan 576b5efe93 Fix RPC console parser to handle escaped arguments more like bash
- Fix issue #1750
2012-08-31 17:23:48 +02:00
Philip Kaufmann d93e5986d7 add default value in -timeout description 2012-08-30 23:28:19 +02:00
Philip Kaufmann a4d4403a75 enable ASLR and DEP for bitcoind.exe via linker flags
- this is already active for bitcoin-qt.exe
2012-08-29 22:22:04 +02:00
Wladimir J. van der Laan 4d1d94c56c Rename CreateThread to NewThread
Prevent clash with win32 API symbol
2012-08-29 20:25:37 +02:00
Jeff Garzik 4445434a2d Merge pull request #1745 from gmaxwell/irc_fixes
Misc IRC fixes.
2012-08-29 11:02:21 -07:00
Wladimir J. van der Laan 61d8507140 implement CreateThread with boost::thread
I'm not sure why this wasn't done before.

- Removes typedef of pthread_t on Windows, which fixes a native compile issue on mingw.
2012-08-29 20:02:07 +02:00
Philip Kaufmann 382e9e25ff Qt: re-order GUI code
- re-order Qt Actions and connect() calls to match the real GUI layout,
  which makes things easier to read and understand
- remove signMessageAction and verifyMessageAction from tabGroup as we
  didn't use them anyway (as tooltips are not displayed in the menu remove
  these too)
- update 2 comments
2012-08-29 19:59:22 +02:00
Philip Kaufmann 5fc3a0f707 remove FIRST_CLASS_MESSAGING support from the client
- removes the FIRST_CLASS_MESSAGING support from the client, which was no
  default setting anyway
2012-08-29 19:57:51 +02:00
Wladimir J. van der Laan 6117afeeaa Update strings for 0.7.0rc2 2012-08-29 19:55:40 +02:00
Wladimir J. van der Laan c7df832d7a Merge pull request #1617 from Diapolo/Show_Hide_string
Update string for Show/Hide in the tray
2012-08-29 10:52:01 -07:00
Wladimir J. van der Laan fc52af2736 Merge pull request #1720 from Diapolo/Qt_about
Qt: add copyrightLabel to aboutdialog.ui
2012-08-29 10:50:17 -07:00
Philip Kaufmann e273c51287 Update string for Show/Hide in the tray
- be clear we don't "Show/Hide Bitcoins", but just the client window
- remove the tooltip for toggleHideAction as this is not shown anyway
- update a comment to be more general
2012-08-29 07:39:35 +02:00
Gregory Maxwell 6a60c64c6b Don't retry a failing IRC nickname forever.
If our IRC nick is in use (because some other node thinks it has
the same address we think we have) don't fruitlessly try to reconnect
using that name forever. After three tries, give up and use a random
nick. Either we'll learn a new local address from IRC and switch
to that, or it was right and the other guy is advertising for us.

This avoids a pessimal case where a second testnet node behind
a nat is unable to get any peers because he can't get on IRC.
2012-08-28 22:04:38 -04:00
Gregory Maxwell 3595b18793 Don't force IRC off if not listening, do force it off if IPv4 is off.
Previously Bitcoin would refuse to use IRC if it was either not
accepting inbound connections or not making outbound. Instead this
changes it to not use IRC only if it's not doing either or if
IPv4 is off completely. If Bitcoin is not listening this will use
the default random nicks rather than the IP based ones.
2012-08-28 21:43:28 -04:00
Pieter Wuille af4da4be3d Bugfix: increase score, not port 2012-08-29 02:33:25 +02:00
Gavin Andresen 286dbba2d2 Give testnet it's own alert key. 2012-08-28 17:13:11 -04:00
Gavin Andresen f35c6c4fb9 Refactor: move alert code from main to alert.cpp/h 2012-08-28 17:04:54 -04:00
xanatos 9eb7fc5842 Changed nprev->pprev
It should be pprev, because the next one is pnext, and it's printing the memory address of the CBlockIndex (so pSomething).
2012-08-28 23:25:52 +03:00
Wladimir J. van der Laan ba7ba84f07 Add boost chrono lib for windows builds (required for boost 1.50) 2012-08-27 22:16:24 +02:00
Gavin Andresen 03fa53a640 Version numbers -> 0.7.0 2012-08-27 14:20:56 -04:00
Matt Corallo a1755ec426 Upgrade to Boost 1.50 2012-08-27 14:20:56 -04:00
Gavin Andresen fde5c34bd8 Merge branch 'alert_fix' of git://github.com/gavinandresen/bitcoin-git 2012-08-27 12:39:13 -04:00
Gavin Andresen ef8e821cf2 Fix compiler warning on mac 2012-08-27 12:37:35 -04:00
Gavin Andresen 8cd98a9a26 Merge branch 'bugfix_gitian' of git://github.com/luke-jr/bitcoin 2012-08-27 11:52:56 -04:00
Gavin Andresen ea2fda46c3 Special-case the last alert for alert-key-compromised case
Hard-code a special nId=max int alert, to be broadcast if the
alert key is ever compromised. It applies to all versions, never
expires, cancels all previous alerts, and has a fixed message:
   URGENT: Alert key compromised, upgrade required

Variations are not allowed (ignored), so an attacker with
the private key cannot broadcast empty-message nId=max alerts.
2012-08-27 10:22:57 -04:00
xanatos 028ec224b8 Removed duplicated lock
Around line 167 there is already a LOCK(bitdb.cs_db) that covers everything. Re-locking is useless.
2012-08-27 15:08:20 +03:00
Luke Dashjr 1837696580 Bugfix: Move boost::interprocess Win32 workaround to Bitcoin-Qt sources, rather than hacking boost in gitian 2012-08-27 00:49:23 +00:00
Gavin Andresen d5a52d9b3e Alert system DoS prevention
This fixes two alert system vulnerabilities found by
Sergio Lerner; you could send peers unlimited numbers
of invalid alert message to try to either fill up their
debug.log with messages and/or keep their CPU busy
checking signatures.

Fixed by disconnecting/banning peers if they send 10 or more
bad (invalid/expired/cancelled) alerts.
2012-08-26 17:08:18 -04:00
Gavin Andresen 772351b0d5 Merge branch '2012_08_progressbarwin' of git://github.com/laanwj/bitcoin 2012-08-25 11:14:11 -04:00
Gavin Andresen 9db9642db4 Merge branch 'nozeroout' of git://github.com/sipa/bitcoin 2012-08-25 11:05:59 -04:00
Gavin Andresen b9c078ea96 Merge branch 'checkpoint' 2012-08-25 11:05:24 -04:00
Wladimir J. van der Laan 12324c1693 Update Czech translation from Transifex 2012-08-25 10:19:35 +02:00