Commit graph

1281 commits

Author SHA1 Message Date
Gavin Andresen
8449a8788a Data-drive script evaluation unit tests. 2012-04-21 19:35:39 -04:00
Pieter Wuille
6a7a42be16 Merge pull request #1126 from drizztbsd/master
Fix build with gcc 4.7
2012-04-21 15:13:29 -07:00
Wladimir J. van der Laan
88dc2d6c6a Integrate @JoelKatz's optimized ToHex (#562) into current HexStr function 2012-04-21 20:37:50 +02:00
Wladimir J. van der Laan
b6c837cbe1 Remove no-longer used UI hints in bitcoin core
The Qt UI has its own associated structures for temporary transaction state / cache.
2012-04-21 18:21:19 +02:00
Wladimir J. van der Laan
cdcc319c2d change type of various bare chars to bool that are only used as bool (and never serialized) 2012-04-21 18:16:11 +02:00
Wladimir J. van der Laan
7be8b2ff9c Add explicit numeric constant value for all opcodes
- Easier for debugging (what opcode was 0x... again?)
- Clarifies that the opcodes are set in stone in the protocol, and signals that it is impossible to insert opcodes in between.
2012-04-21 10:34:18 +02:00
Pieter Wuille
e46704dd90 Expose CRPCTable via bitcoinrpc.h for testing 2012-04-21 01:37:34 +02:00
Pieter Wuille
9862229d4d Encapsulate mapCommands in class CRPCTable 2012-04-21 01:20:05 +02:00
Jeff Garzik
dc42bf52c1 Encapsulate RPC command dispatch in an array of CRPCCommand's 2012-04-21 01:20:05 +02:00
Wladimir J. van der Laan
00b9c0f4b2 Merge pull request #1122 from dlitz/unsigned-char-fix
Unsigned char fix & fix undefined phexdigits[255]
2012-04-20 10:18:45 -07:00
Timothy Redaelli
9553c35d89 Add missing includes. (Fix bulding under GCC 4.7) 2012-04-20 12:50:57 +02:00
Pieter Wuille
c73ba23eb5 gettransaction RPC for non-wallet transactions
Works for wallet transactions, memory-pool transaction and block chain
transactions.

Available for all:
 * txid
 * version
 * locktime
 * size
 * coinbase/inputs/outputs
 * confirmations

Available only for wallet transactions:
 * amount
 * fee
 * details
 * blockindex

Available for wallet transactions and block chain transactions:
 * blockhash
 * time
2012-04-18 23:42:07 +02:00
R E Broadley
871c3557bf Added ability to respond to signals during Block Loading stage. 2012-04-18 12:30:24 +01:00
Dwayne C. Litzenberger
8c8e8c2e93 Fix bugs on 'unsigned char' platforms.
In ISO C++, the signedness of 'char' is undefined.  On some platforms (e.g.
ARM), 'char' is an unsigned type, but some of the code relies on 'char' being
signed (as it is on x86).  This is indicated by compiler warnings like this:

 bignum.h: In constructor 'CBigNum::CBigNum(char)':
 bignum.h:81:59: warning: comparison is always true due to limited range of data type [-Wtype-limits]

 util.cpp: In function 'bool IsHex(const string&)':
 util.cpp:427:28: warning: comparison is always false due to limited range of data type [-Wtype-limits]

In particular, IsHex erroneously returned true regardless of the input
characters, as long as the length of the string was a positive multiple of 2.

Note: For testing, it's possible using GCC to force char to be unsigned by
adding the -funsigned-char parameter to xCXXFLAGS.
2012-04-18 00:33:32 -04:00
Dwayne C. Litzenberger
a6fa147c8d Fix phexdigits[255] is undefined. 2012-04-18 00:33:32 -04:00
Pieter Wuille
559fc3c610 Add missing breaks in optionmodel's switch case 2012-04-17 23:27:59 +02:00
Pieter Wuille
031eae7864 Merge pull request #1114 from sipa/lesssync
Reduce sync frequency for blkindex.dat
2012-04-17 14:23:31 -07:00
Pieter Wuille
0a83c0fcef Fix tests after recent refactors 2012-04-17 20:37:47 +02:00
Pieter Wuille
c23617fef3 Merge remote-tracking branch 'jgarzik/mempool' 2012-04-17 20:12:48 +02:00
Pieter Wuille
caeddc5d37 Merge pull request #1117 from sipa/deadlockfix
Fix potential deadlock
2012-04-17 11:05:02 -07:00
Pieter Wuille
6b6aaa1698 Further reduce header dependencies
This commit removes the dependency of serialize.h on PROTOCOL_VERSION,
and makes this parameter required instead of implicit. This is much saner,
as it makes the places where changing a version number can have an
influence obvious.
2012-04-17 20:03:42 +02:00
Jeff Garzik
ccd65d4261 Move proto version to version.h. Reduce header deps a bit more. 2012-04-17 20:02:38 +02:00
Jeff Garzik
9eace6b113 Move CWalletDB code to new walletdb module.
In addition to standard code separation, this change opens the door
to fixing several include inter-dependencies.
2012-04-17 20:00:55 +02:00
Pieter Wuille
ed6d0b5f85 Remove headers.h 2012-04-17 20:00:55 +02:00
Gavin Andresen
b97d54355e Merge pull request #1106 from jgarzik/sign-compare
Fix many sign-comparison warnings found in bitcoin codebase
2012-04-17 10:55:56 -07:00
Gavin Andresen
e873dc654c Merge pull request #1115 from laanwj/2012_04_cleanupmisc
Delete unused, unreachable and commented code, add missing initializer
2012-04-17 10:12:33 -07:00
Pieter Wuille
c581cc16bb Fix potential deadlock
Conflict:
* cs_main in ProcessMessages() (before calling ProcessMessages)
* cs_vSend in CNode::BeginMessage
versus:
* cs_vSend in ThreadMessageHandler2 (before calling SendMessages)
* cs_main in SendMessages

Even though cs_vSend is a try_lock, if it succeeds simultaneously with
the locking of cs_main in ProcessMessages(), it could cause a deadlock.
2012-04-17 18:50:52 +02:00
Jeff Garzik
ce8c93498a main.cpp: replace tabs with spaces
Sometimes they sneak in through the 'vi' door
2012-04-17 12:31:51 -04:00
Jeff Garzik
8bff8ac079 AlreadyHave(): only hold lock during mapTransactions access 2012-04-17 12:30:00 -04:00
Wladimir J. van der Laan
7fa3ad83a9 Remove unused and unreachable code 2012-04-17 18:28:02 +02:00
Wladimir J. van der Laan
4941aad657 Add forgotten initializer 2012-04-17 18:27:55 +02:00
Pieter Wuille
8f2b50f178 Reduce sync frequency for blkindex.dat
Since auto-remove-db-logs was enabled, each time a CTxDB was closed
outside of the initial download window, it causes a checkpoint + log
cleanup. This is overkill, so reduce the sync frequency to once per
minute at most.
2012-04-17 18:27:18 +02:00
Jeff Garzik
dd21ce5f1b Merge pull request #1094 from jgarzik/already-have-locking
Locking fix for AlreadyHave()
2012-04-17 09:23:49 -07:00
Jeff Garzik
ea9627979e Bump PROTOCOL_VERSION to 60001, thereby enabling BIP31 2012-04-17 12:16:46 -04:00
Jeff Garzik
865a0c1674 Merge pull request #1081 from jgarzik/pong
BIP 0031: pong message
2012-04-17 08:51:17 -07:00
Wladimir J. van der Laan
7a5452ffb3 Merge pull request #1092 from laanwj/2012_04_sendcoins_setlabelfix
When sending coins, set label when selecting address that already has a label
2012-04-16 05:41:39 -07:00
Wladimir J. van der Laan
088a13331b Merge pull request #1091 from Diapolo/GUI-BlockDL
revert to default OS theme for progressbar (fix #1071)
2012-04-16 00:55:37 -07:00
Jeff Garzik
9fb89c26f3 Fix misc. minor sign-comparison warnings 2012-04-15 17:00:20 -04:00
Jeff Garzik
0dd710acb6 CNode's nHeaderStart may be negative, so change its type 2012-04-15 16:59:48 -04:00
Jeff Garzik
c3fad8350b serialize.h: CAutoFile's read and write may take size_t nSize 2012-04-15 16:59:09 -04:00
Jeff Garzik
3a78f82a78 Fix sign-compare warnings: netbase's Lookup* max-solutions may be unsigned 2012-04-15 16:58:32 -04:00
Jeff Garzik
c376ac359e Fix loop index var types, fixing many minor sign comparison warnings
foo.size() typically returns an unsigned integral type; make loop variables
match those types' signedness.
2012-04-15 16:52:09 -04:00
Jeff Garzik
ab9dc75a18 The string class returns string::npos, when find() fails.
Noticed when sign-comparison warnings were enabled.
2012-04-15 16:47:24 -04:00
Jeff Garzik
ca4c4c53a8 CTxMemPool: add helper methods, to reduce global mempool.mapTx accesses 2012-04-15 14:43:19 -04:00
Jeff Garzik
d01903e751 CTxMemPool: encapsulate AcceptToMemoryPool 2012-04-15 14:43:19 -04:00
Jeff Garzik
8e45ed66dd CTxMemPool: encapsulate AddToMemoryPoolUnchecked(), RemoveFromMemoryPool(),
and nPooledTx
2012-04-15 14:42:52 -04:00
Jeff Garzik
235507ae48 New class CTxMemPool, encapsulating TX memory pool data members 2012-04-15 14:41:27 -04:00
Jeff Garzik
5a701eb7ea Merge pull request #1104 from laanwj/2012_04_clang
Enable and fix most compilation warnings
2012-04-15 11:39:15 -07:00
Jeff Garzik
fced2231f8 Merge pull request #1084 from dooglus/validate_secret
importprivkey doesn't check that it is given a private key
2012-04-15 09:25:29 -07:00
Wladimir J. van der Laan
9ea8e60a0c Merge pull request #1097 from laanwj/2012_04_runawayexception
Show a message box when runaway exception happens
2012-04-15 09:22:26 -07:00
Wladimir J. van der Laan
da7bbd9dfd fix warnings: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] 2012-04-15 13:40:14 +02:00
Wladimir J. van der Laan
6642ffb761 fix warnings: '&&' within '||' [-Wlogical-op-parentheses] 2012-04-15 13:40:14 +02:00
Wladimir J. van der Laan
2e120f28e0 fix warnings: delete called on 'XX' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] 2012-04-15 13:40:14 +02:00
Wladimir J. van der Laan
11cd416525 fix warnings: unused variable 'XX' [-Wunused-variable] 2012-04-15 13:40:14 +02:00
Wladimir J. van der Laan
76d8170ce8 fix warnings: enumeration values 'XX' not handled in switch [-Wswitch-enum] 2012-04-15 13:40:14 +02:00
Wladimir J. van der Laan
87207a2e08 fix warnings: 'XX' defined as a struct here but previously declared as a class [-Wmismatched-tags] 2012-04-15 13:40:14 +02:00
Wladimir J. van der Laan
8add7822ce fix warnings: array subscript is of type 'char' [-Wchar-subscripts] 2012-04-15 13:40:14 +02:00
Wladimir J. van der Laan
1f29d399f4 work around issue in boost::program_options that prevents from compiling in clang 2012-04-15 13:40:14 +02:00
Wladimir J. van der Laan
f9f625fb32 enable all warnings except invalid-offsetof, sign-compare, unused-parameter 2012-04-15 13:40:14 +02:00
Luke Dashjr
2eb665c634 Bugfix: Check that QRcode_encodeString didn't return NULL (error)
Without this, any error will segfault Bitcoin-Qt
2012-04-14 21:00:27 -04:00
Wladimir J. van der Laan
a7a0c7a1bf Show a message box when runaway exception happens
This is more clear to users than when the program simply disappears (usually during initialization). It still logs the message to the console and debug log as well.
2012-04-14 18:35:42 +02:00
Jeff Garzik
22014c31e5 Merge pull request #1093 from jgarzik/tx-opt
Database micro-optimization for "tx" network message
2012-04-14 08:50:43 -07:00
Wladimir J. van der Laan
46ba858817 Merge pull request #1089 from laanwj/2012_04_translationupdate
Update translations for bitcoin core
2012-04-13 23:47:50 -07:00
Wladimir J. van der Laan
3fddc8effc Update translations for bitcoin core
- Move scripts/qt to share/qt, to clean up toplevel directories
- Update english ts file which is used to source messages for Transifex
- In extract_strings_qt.py use a glob *.h *.cpp, this is safe now that the Wx UI files are removed
2012-04-14 08:46:16 +02:00
Wladimir J. van der Laan
b970067298 Do not show green tick unless all known blocks are downloaded (fixes #921) 2012-04-14 08:21:22 +02:00
Jeff Garzik
8deb9822e4 Locking fix for AlreadyHave()
Access to mapTransactions[] must be guarded by cs_mapTransactions lock.

Also, reformat long lines to make the switch statement more readable.
2012-04-13 18:24:55 -04:00
Jeff Garzik
9925d34a49 Database micro-optimization for "tx" network message
Open database once per "tx" message, rather than multiple times,
in the case of orphan transaction presence.

As a side effect, a now-unused CTransaction::AcceptToMemoryPool()
variant is removed.
2012-04-13 17:48:15 -04:00
Wladimir J. van der Laan
2d67195ed2 Set label when selecting an address that already has a label. Fixes #1080. 2012-04-13 21:08:46 +02:00
Philip Kaufmann
e72c6a1830 revert to default OS theme for progressbar / fix small glitches in bitcoingui.cpp 2012-04-13 18:25:56 +02:00
Wladimir J. van der Laan
6b8e7eefcc Add missing tooltip and key shortcut in settings dialog (#1088 without line break part) 2012-04-13 09:16:46 +02:00
Gavin Andresen
c3c203ccd9 Merge pull request #1087 from sipa/fix_1086
Fix #1086: add /testnet to passed datadir
2012-04-12 18:22:15 -07:00
Pieter Wuille
7a743148c9 Fix #1086: add /testnet to passed datadir 2012-04-13 03:11:14 +02:00
Jeff Garzik
8b09cd3a4d Replace several network protocol version numbers with named constants
stored in version.h.

Also, a minor CAddress code reformat while we're in there, fixing
some incorrect indentation.
2012-04-12 20:07:49 -04:00
Chris Moore
b3a6e613fc CBitcoinSecret::SetString() now calls IsValid() to make sure it was passed something with the correct version. 2012-04-12 13:13:08 -07:00
Gavin Andresen
b7dc02381f Merge pull request #1041 from gavinandresen/listtransactionsfix
Bug fix listtransactions from/count handling.
2012-04-12 12:20:51 -07:00
Wladimir J. van der Laan
181400c3d5 make text in about box selectable (fixes #1055) 2012-04-12 20:55:38 +02:00
Philip Kaufmann
7261945eb5 enable wordWrap on lblQRCode / small code comment change 2012-04-12 20:34:06 +02:00
Philip Kaufmann
b1a99c3a1f limit length of generated URI to 255 chars to prevent a DoS against the QR-Code dialog 2012-04-12 20:34:06 +02:00
Philip Kaufmann
1e8c62b29c updated to reflect pull-request suggestions / renamed some GUI elements 2012-04-12 20:34:05 +02:00
Philip Kaufmann
9e0dba8c17 fixed amount part of URI in QR-Codes / removed (no label) string if we have NO label / coding style updates / removed an unused variable 2012-04-12 20:34:04 +02:00
Jeff Garzik
460b66b14b Remove obsolete Win32 AffinityBugWorkaround()
Reference miner exists for testnet-in-a-box type situations, and as a
reference.  We don't care enough about highly optimized internal
mining to keep workarounds like this.
2012-04-12 13:24:00 -04:00
Jeff Garzik
b87c0fc440 version.h: separate client, net sections. Move more constants to this file.
* move PROTOCOL_VERSION to version.h

* move CLIENT_VERSION* to version.h, make available past cpp stage

* clearly separate client, network version portions of version.h
2012-04-12 12:23:58 -04:00
Jeff Garzik
93e447b631 BIP 0031: pong message
Add a pong message that is sent in reply to a ping. It echoes back a nonce
field that is now added to the ping message. Send a nonce of zero in ping
messages.

Original author: Mike Hearn @ Google

Modified Mike's change to introduce a mild form of protocol documentation in
version.h.
2012-04-12 12:11:56 -04:00
Gavin Andresen
940e22fd81 Fix OSX build errors. 2012-04-12 11:14:46 -04:00
Wladimir J. van der Laan
4ac24cf59e Merge pull request #855 from sje397/ToggleHide
Toggle UI hide
2012-04-11 23:02:18 -07:00
Pieter Wuille
ee12c3d60c Use filesystem::path instead of manual string tinkering
Where possible, use boost::filesystem::path instead of std::string or
char* for filenames. This avoids a lot of manual string tinkering, in
favor of path::operator/.

GetDataDir is also reworked significantly, it now only keeps two cached
directory names (the network-specific data dir, and the root data dir),
which are decided through a parameter instead of pre-initialized global
variables.

Finally, remove the "upgrade from 0.1.5" case where a debug.log in the
current directory has to be removed.
2012-04-11 22:30:23 +02:00
Wladimir J. van der Laan
bcaa5f1c04 Merge pull request #1083 from laanwj/2012_04_connectionicon
Make 4th bar of connection icon green
2012-04-11 11:06:26 -07:00
Gavin Andresen
2232717cba Remove path.make_preferred() calls, and fix compiler error in bitcoinrpc RE: boost::system 2012-04-11 14:00:48 -04:00
Wladimir J. van der Laan
5ca4f13b87 by popular request, make 4th bar of connection icon green 2012-04-11 19:59:15 +02:00
Pieter Wuille
4577167170 Fix build.h dependencies
For Qt builds, the build.h file is moved to build/build.h. For regular
builds, it is moved to obj/build.h. This allows the Qt build to be done
in a different directory than the source, and without interfering with
other builds.
2012-04-11 14:04:42 +02:00
Pieter Wuille
702764f53b Merge pull request #1054 from sipa/buildinfo
Build identification strings
2012-04-10 13:31:12 -07:00
Wladimir J. van der Laan
b56772e5df Merge pull request #1046 from laanwj/2012_04_rpcporterror
Show error message instead of exception crash when unable to bind RPC port
2012-04-10 13:14:47 -07:00
Pieter Wuille
a20c0d0f67 Build identification strings
All client version information is moved to version.cpp, which optionally
(-DHAVE_BUILD_INFO) includes build.h. build.h is automatically generated
on supporting platforms via contrib/genbuild.sh, using git describe.

The git export-subst attribute is used to put the commit id statically
in version.cpp inside generated archives, and this value is used if no
build.h is present.

The gitian descriptors are modified to use git archive instead of a
copy, to create the src/ directory in the output. This way,
src/src/version.cpp will contain the static commit id. To prevent
gitian builds from getting the "-dirty" marker in their git-describe
generated identifiers, no touching of files or running sed on the
makefile is performed anymore. This does not seem to influence
determinism.
2012-04-10 18:16:53 +02:00
sje397
86d5634941 Toggle main window hide on tray icon click
- converted openBictoinAction to toggleHideAction
- put GUIUtil functions into a namespace instead of a class
- put window-related functions together in optionsdialog

Reasoning:
- toggle is more typical behaviour
- it's more functional
- better UX

The typical issue with toggling visibility is that when a window
is obscured by other windows but in the 'shown' state, hiding it
isn't what you want. I've added an 'isObscured' function to GUIUtil
that checks several pixels in the window to see if they are visible
on the desktop so that an obscured but shown window can be raised.

Conflicts:

	src/qt/guiutil.cpp
	src/qt/guiutil.h
2012-04-11 00:07:32 +10:00
Pieter Wuille
1a275bac2b Merge pull request #1052 from sipa/scopedlocks
Use scoped locks instead of CRITICAL_BLOCK
2012-04-09 13:25:17 -07:00
Gavin Andresen
1044391135 Merge branch 'filesystem' of https://github.com/Diapolo/bitcoin 2012-04-09 10:41:59 -04:00
Pieter Wuille
f342dac1cb Do not report spurious deadlocks caused by TRY_LOCK 2012-04-09 01:59:57 +02:00
Pieter Wuille
908037fe16 Support for parametrized locks in deadlock detector 2012-04-09 01:59:57 +02:00
Pieter Wuille
f8dcd5ca6f Use scoped locks instead of CRITICAL_BLOCK 2012-04-09 01:59:46 +02:00
Luke Dashjr
fa2544e79f Bugfix: Replace "URL" with "URI" where we aren't actually working with URLs 2012-04-06 12:53:37 -04:00
Wladimir J. van der Laan
3e34352222 Show error message instead of exception crash when unable to bind RPC port
Fixes issue #875
2012-04-06 18:41:23 +02:00
Philip Kaufmann
42c63d3ad2 fixed small error in bitcoinrpc.cpp 2012-04-06 15:31:28 +02:00
Philip Kaufmann
36949554ab updated util.cpp to use make_preferred() 2012-04-06 15:29:20 +02:00
Philip Kaufmann
93fb7489a7 updated bitcoinrpc.cpp to use make_preferred() and removed double inclusion of boost/filesystem.hpp 2012-04-06 15:29:19 +02:00
Philip Kaufmann
9c24588e73 updated db.cpp to use make_preferred() 2012-04-06 15:29:18 +02:00
Pieter Wuille
9362da78b0 Merge pull request #1033 from sipa/wait
Condition variables instead of polling
2012-04-06 04:11:14 -07:00
graingert
f9781fc62e Change sign message bitcoin address tooltip to "The address to sign the message with" Closes #1050 2012-04-06 04:08:16 +02:00
Pieter Wuille
e88ed65a39 Flush on log size instead of transaction count 2012-04-05 20:29:47 +02:00
Gavin Andresen
399ff1fe05 Merge pull request #1043 from Diapolo/misc
removed obsolete boost workaround (boost ticket #4258)
2012-04-05 07:36:23 -07:00
Gavin Andresen
895c12943b Merge pull request #1042 from gavinandresen/use_ssl_cleanup
Remove USE_SSL #define
2012-04-05 07:34:45 -07:00
Gavin Andresen
ea2cc8fc4a Merge pull request #1037 from gavinandresen/addmultisigenable
Enable addmultisigaddress RPC call for main network
2012-04-05 07:34:19 -07:00
Gavin Andresen
c7fa55bb87 Merge pull request #1036 from gavinandresen/pubsubcleanup
Remove half-implemented publish/subscribe system
2012-04-05 07:33:54 -07:00
Gavin Andresen
78494ffecc Merge pull request #1035 from gavinandresen/osxbuild
Add ifdef RELEASE to makefile.osx as the compile-for-older-macs flags
2012-04-05 07:33:00 -07:00
Gregory Maxwell
4a8d0f3b10 Merge pull request #1039 from sipa/fix_955
Fix #955: Verify status of encrypt/decrypt calls to detect failed padding
2012-04-05 06:17:05 -07:00
Philip Kaufmann
7f10522c43 removed obsolete boost workaround (boost ticket #4258) 2012-04-05 08:34:31 +02:00
Gavin Andresen
5ce4c2a23a Remove USE_SSL #define 2012-04-04 21:19:27 -04:00
Gavin Andresen
723cafcbcf Bug fix listtransactions from/count handling. 2012-04-04 20:56:13 -04:00
Pieter Wuille
e5c027b49b Verify status of encrypt/decrypt calls to detect failed padding 2012-04-05 02:07:53 +02:00
Philip Kaufmann
fc42e9fae2 removed an unused / obsolete tag from bitcoin.qrc 2012-04-05 00:11:22 +02:00
Gavin Andresen
ea8c55cfd7 Enable addmultisigaddress RPC call for main network 2012-04-04 16:01:27 -04:00
Gavin Andresen
f487746ded Remove half-implemented publish/subscribe system 2012-04-04 15:56:00 -04:00
Gavin Andresen
3a8ca61bd0 Add ifdef RELEASE to makefile.osx as the compile-for-older-macs flags 2012-04-04 15:45:31 -04:00
Pieter Wuille
092631f0ba Condition variable for outbound connection slots
Keep a global counter for nOutbound, protected with its own waitable
critical section, and wait when all outbound slots are filled, rather
than polling.

This removes the (on average) 1 second delay between a lost connection
and a new connection attempt, and may speed up shutdowns.
2012-04-04 17:24:13 +02:00
Pieter Wuille
712fd182b7 Locking system overhaul, add condition variables
This commit simplifies the locking system: CCriticalSection becomes a
simple typedef for boost::interprocess::interprocess_recursive_mutex,
and CCriticalBlock and CTryCriticalBlock are replaced by a templated
CMutexLock, which wraps boost::interprocess::scoped_lock.

By making the lock type a template parameter, some critical sections
can now be changed to non-recursive locks, which support waiting via
condition variables. These are implemented in CWaitableCriticalSection
and WAITABLE_CRITICAL_BLOCK.

CWaitableCriticalSection is a wrapper for a different Boost mutex,
which supports waiting/notification via condition variables. This
should enable us to remove much of the used polling code. Important
is that this mutex is not recursive, so functions that perform the
locking must not call eachother.

Because boost::interprocess::scoped_lock does not support assigning
and copying, I had to revert to the older CRITICAL_BLOCK macros that
use a nested for loop instead of a simple if.
2012-04-04 16:21:08 +02:00
Pieter Wuille
b0a7e05a45 Merge pull request #1019 from laanwj/2012_03_uirefactor
Streamline UI ↔ Core interface
2012-04-04 05:03:07 -07:00
Wladimir J. van der Laan
cadae3588c Merge pull request #1025 from Diapolo/GUI-BlockDL
modified block DL progressbar to be more informative and precise
2012-04-04 04:36:09 -07:00
Wladimir J. van der Laan
5cccb13dad Move from noui.h / ui.h to one ui_interface.h with dummy implementation for the daemon. 2012-04-04 13:19:30 +02:00
Wladimir J. van der Laan
5a60b66a9d Use a messagebox to display the error when -server is provided without providing a rpc password 2012-04-04 09:37:26 +02:00
Wladimir J. van der Laan
7cfbe1fee4 qtui.h/noui.h interface cleanup
- rename wxMessageBox, remove redundant arguments to noui/qtui calls
- also, add flag to force blocking, modal dialog box for disk space warning etc
- clarify function naming
- no more special MessageBox needed from AppInit2, as window object is created before calling AppInit2
2012-04-04 09:37:25 +02:00
Wladimir J. van der Laan
1a3f0da922 support RPC stop and encryptwallet with UI 2012-04-04 09:35:01 +02:00
Wladimir J. van der Laan
5d7cebdadc move translation function _ to qtui.h/noui.h instead of util.h 2012-04-04 09:35:01 +02:00
Wladimir J. van der Laan
6cb6d62347 remove dependency on serialize.h and util.h for SecureString 2012-04-04 09:35:01 +02:00
Wladimir J. van der Laan
f0b5e9e116 remove unused CalledSetStatusBar and UIThreadCall notifications 2012-04-04 09:35:01 +02:00
Wladimir J. van der Laan
98e6175874 Update UI through async calls MainFrameRepaint and AddressBookRepaint instead of a timer.
- Overall, this is better design
- This fixes problems with the address book UI not updating when the address book is changed through RPC
- Move Statusbar change detection responsibility to ClientModel
2012-04-04 09:35:01 +02:00
Philip Kaufmann
75b6323200 remove HTML code around "Wallet" (displayed on overview page) and use Qt tags for font settings 2012-04-04 09:07:55 +02:00
Wladimir J. van der Laan
7e7bcce2d9 Code deduplication: make function in GUIUtil to get connection type to call object slot in GUI thread
with invokeMethod.
2012-04-04 08:46:12 +02:00
Wladimir J. van der Laan
55f69a4700 move QT_PLUGINS stuff to qt main file, where it belongs 2012-04-04 08:46:12 +02:00
Wladimir J. van der Laan
52d3a48128 VC2010 compile fixes 2012-04-03 20:22:41 +02:00
Philip Kaufmann
853a4a81b3 clarified comment why we use an own progressbar style / included "~" in the tr() call 2012-04-03 09:42:34 +02:00
Philip Kaufmann
ec9a4904f3 changed percentage done in tooltip to float to be more precise / allowed plurals in translation for "x block(s) remaining" 2012-04-03 08:30:13 +02:00
Gregory Maxwell
3263a245bb Merge pull request #1026 from laanwj/2012_04_increase_up_to_date_time
Increase time ago of last block for "up to date" status from 30 to 90 minutes
2012-04-02 20:35:44 -07:00
Philip Kaufmann
a7a69cd07a polished code and fixed progress display (was very jerky at the end of a sync) 2012-04-02 23:51:40 +02:00
Philip Kaufmann
e9de46c436 color update for progress bar 2012-04-02 23:48:24 +02:00
Philip Kaufmann
c7c0c93172 implemented OS independent progress bar style / moved one-time functions used on the bar to a better code location 2012-04-02 23:48:23 +02:00
Philip Kaufmann
5519660a0d changed progressbar text to "~n blocks remaining" 2012-04-02 23:48:22 +02:00
Philip Kaufmann
068ed1e838 removed relative progressbar display and moved re-worked network detection code to setNumBlocks() 2012-04-02 23:48:22 +02:00
Philip Kaufmann
9ceae8acea modified block DL progressbar to be dynamic and more precise 2012-04-02 23:48:21 +02:00
Wladimir J. van der Laan
2675fe6218 Increase time ago of last block for "up to date" status from 30 to 90 minutes
It was too hyperactive.
gmaxwell: I mean that right now when the block gap goes over an hour it starts showing synchronizing. Increasing that to 90 minutes or so would make it only happen about 6.4 times per year
2012-04-02 20:37:55 +02:00
Gavin Andresen
85ea8b4f43 Merge pull request #951 from TheBlueMatt/headerslimit
Limit getheaders to a hard 2000.
2012-04-02 11:22:11 -07:00
Pieter Wuille
91c5132ab5 Merge pull request #998 from Diapolo/transactiontable
removed an ugly line break in a transaction tooltip
2012-04-02 07:19:22 -07:00
Pieter Wuille
d3f220b2c2 Merge pull request #1022 from Diapolo/fix#1020
fix for #1020
2012-04-02 07:08:14 -07:00
Pieter Wuille
fdef04e77b Merge pull request #995 from Diapolo/master
fixed typo in comment in netbase.h and bignum.h
2012-04-02 07:07:48 -07:00
Pieter Wuille
542a1380aa Merge pull request #1006 from Diapolo/tr-tray
made tray icon tooltip translatable
2012-04-02 07:07:21 -07:00
Gavin Andresen
f3da2a88c9 Bump version to 0.6.0.99 for 0.6.1 merge window 2012-04-02 10:03:26 -04:00
Philip Kaufmann
b5271c8861 hide Delete button (only) on ReceivingTab / hide Sign message button (only) on SendingTab 2012-04-01 13:22:34 +02:00
Philip Kaufmann
7e05b97229 fixed typo in comment in netbase.h and bignum.h 2012-03-30 07:44:35 +02:00
Gavin Andresen
a1c3d8f14d Merge branch 'master' of github.com:bitcoin/bitcoin 2012-03-29 15:11:04 -04:00
Gavin Andresen
f146061d24 Merge pull request #1010 from sipa/fastblocks2
Use transactions-updated as flush condition
2012-03-29 12:10:30 -07:00
Pieter Wuille
25c5eca893 Use transactions-updated as flush condition
The normal checkpointing during the block chain download is reduced
to every five minutes only, but forced every 200000 updated transactions.
2012-03-29 21:00:31 +02:00
Gavin Andresen
f3f9da868e Bump version to 0.6.0rc6 2012-03-29 13:58:22 -04:00
Gavin Andresen
6293a9f87f Workaround hangs when upgrading old addr.dat files 2012-03-29 13:34:07 -04:00
Gavin Andresen
83e914c1d5 Merge pull request #1007 from gavinandresen/log_auto_remove
Auto-remove logs, and decrease logfile size to 10M
2012-03-29 10:13:42 -07:00
Gavin Andresen
9f18347034 Auto-remove logs, and decrease logfile size to 10M 2012-03-29 09:03:11 -04:00
Philip Kaufmann
3d1d5fafc1 made tray icon tooltip translatable 2012-03-29 07:59:15 +02:00
Philip Kaufmann
0b637e0b86 removed an ugly line break in a transaction tooltip for case TransactionStatus::Mature 2012-03-27 23:20:09 +02:00
Philip Kaufmann
7b2eecd428 update translations from transifex 2012-03-27 10:13:38 +02:00
Gavin Andresen
8d29329f93 Update version to 60005 (0.6.0rc5) 2012-03-26 15:42:06 -04:00
Gavin Andresen
c698633447 Merge branch 'master' of github.com:bitcoin/bitcoin 2012-03-26 15:31:32 -04:00
Gavin Andresen
c289d95d6b Merge pull request #991 from gavinandresen/disableWinURI
Disable bitcoin: URI handling on Windows for the 0.6 release
2012-03-26 12:31:06 -07:00
Wladimir J. van der Laan
57de7cd603 Merge pull request #990 from sipa/doc
Begin doxygen-compatible comments
2012-03-26 12:27:49 -07:00
Gavin Andresen
bf5b80a8ae Merge branch 'deladdr' of https://github.com/sipa/bitcoin 2012-03-26 14:32:26 -04:00
Pieter Wuille
53cb1a49e7 Use erase instead of rewrite to remove old addr entries 2012-03-26 20:22:38 +02:00
Gavin Andresen
7b90edb5a6 Disable bitcoin: URI handling on Windows for the 0.6 release 2012-03-26 12:18:24 -04:00
Pieter Wuille
6b8de05d0a Begin doxygen-compatible comments 2012-03-26 16:48:23 +02:00
Philip Kaufmann
4004b9a40b make sure Window is shown when clicking bitcoin: Links to get user attention 2012-03-26 09:19:49 +02:00
Pieter Wuille
01a196e08d Merge pull request #974 from sipa/walletupgrade
Introduce explicit -walletupgrade option
2012-03-25 19:44:52 -07:00
Pieter Wuille
59e659fcc0 Merge pull request #983 from laanwj/2012_03_removeunusedutil
Remove unused functions from util.h/util.cpp (EOM)
2012-03-25 19:31:03 -07:00
Pieter Wuille
bf1afb02ca Give DNS seeds a random age between 3 and 7 days old
This speeds up initial connections with an old/large addr.dat a lot.
2012-03-25 16:06:16 +02:00
Wladimir J. van der Laan
a6aee96c7e remove unused functions from util.h/util.cpp 2012-03-25 12:33:30 +02:00
Pieter Wuille
439e1497e1 Introduce explicit -walletupgrade option
Do not automatically change the wallet format unless the user takes an
explicit action that implies an upgrade (encrypting, for now), or uses
-walletupgrade.

-walletupgrade optionally takes an integer argument: the client version
up to which upgrading is allowed. Without an argument, it is upgraded
to latest supported version. If an argument to -walletupgrade is
provided at the time the wallet is created, the new wallet will initially
not use features beyond that version.

Third, the current wallet version number is reported in getinfo.
2012-03-22 23:47:29 +01:00
Gavin Andresen
958fe01c32 Merge branch 'checklevel' of https://github.com/sipa/bitcoin 2012-03-22 12:18:56 -04:00
Gavin Andresen
e12d131734 Merge pull request #975 from sipa/versioncheck
Check minversion before loading the rest of the wallet
2012-03-22 09:18:11 -07:00
Gavin Andresen
a6b4a11385 Merge branch 'addrman' of https://github.com/sipa/bitcoin 2012-03-22 09:19:01 -04:00
Gavin Andresen
0e894be626 Merge pull request #964 from sipa/fastblocks
Speed up block downloading
2012-03-22 06:17:44 -07:00
Gavin Andresen
e53f03172a Merge branch 'master' of github.com:bitcoin/bitcoin 2012-03-22 08:51:37 -04:00
Wladimir J. van der Laan
5cd806a03e Merge pull request #969 from laanwj/2012_03_printconsole_error
replace call to PrintConsole with call to error()
2012-03-21 23:42:20 -07:00
Pieter Wuille
ef12c2184d Check minversion before loading the rest of the wallet
When a 0.6 wallet with compressed pubkeys is created, it writes a
minversion record to prevent older clients from reading it. If the 0.5
loading it sees a key record before seeing the minversion record however,
it will fail with DB_CORRUPT instead of DB_TOO_NEW.
2012-03-22 04:59:59 +01:00
Pieter Wuille
4538e45c46 Add -checklevel and improve -checkblocks
-checkblocks now takes a numeric argument: the number of blocks that must
be verified at the end of the chain. Default is 2500, and 0 means all
blocks.

-checklevel specifies how thorough the verification must be:
0: only check whether the block exists on disk
1: verify block validity (default)
2: verify transaction index validity
3: check transaction hashes
4: check whether spent txouts were spent within the main chain
5: check whether all prevouts are marked spent
6: check whether spent txouts were spent by a valid transaction that consumes them
2012-03-22 03:19:23 +01:00
Gavin Andresen
8f188ece3c Remove -bip16 and -paytoscripthashtime command-line arguments 2012-03-21 15:45:58 -04:00
Wladimir J. van der Laan
4a43dfbf3e replace call to PrintConsole with call to error()
As these are equivalent functions, this cleans up the source a bit.
Also remove PrintConsole() as this was the only use.
2012-03-21 20:33:53 +01:00
Gavin Andresen
2e2c04e250 Merge pull request #947 from ali1234/master
When disconnecting a node, the receive buffer should be cleared
2012-03-21 12:24:57 -07:00
Gavin Andresen
b2fe3a5ca6 Merge pull request #948 from sipa/unstuck
Prevent stuck block download in large reorganisations
2012-03-21 12:16:28 -07:00
Gavin Andresen
c2b1ab072c Merge pull request #965 from khorben/master
The generic UNIX Makefile builds with lots of warnings
2012-03-21 07:45:49 -07:00
Pieter Wuille
a1a0469f91 More debug output for failed reorganizations 2012-03-21 13:15:27 +01:00
Michael
246c20e8a9 Correct date 2012-03-21 15:56:38 +08:00
Wladimir J. van der Laan
4046bdf18a Merge pull request #954 from Diapolo/master
language updates for source file bitcoin_en.ts + remove cs_CZ (issue #958)
2012-03-21 00:18:58 -07:00
Pieter Wuille
0aa89c08ff Prevent stuck block download in large reorganisations
In cases of very large reorganisations (hundreds of blocks), a situation
may appear where an 'inv' is sent as response to a 'getblocks', but the
last block mentioned in the inv is already known to the receiver node.
However, the supplying node uses a request for this last block as a
trigger to send the rest of the inv blocks. If it never comes, the block
chain download is stuck.

This commit makes the receiver node always request the last inv'ed block,
even if it is already known, to prevent this problem.
2012-03-21 05:09:02 +01:00
Pieter Wuille
89516bd4e0 Speed up block downloading 2012-03-21 01:32:00 +01:00
Pierre Pronchery
7868808b2f Avoid some pointless warnings while compiling 2012-03-21 00:08:19 +01:00
Gavin Andresen
eae82d8ee5 Use last checkpoint instead of hard-coded 140,700. Fixes #913. 2012-03-20 13:45:45 -04:00
p2k
3f1bb1ac78 Proper support for Growl 1.3 notifications 2012-03-20 12:54:51 -04:00
Pieter Wuille
9aa459b294 assertion in CBlock::SetBestChainInner was too strong 2012-03-20 16:41:36 +01:00
Philip Kaufmann
d6b08f6f2c remove bitcoin_cs_CZ from bitcoin.qrc and delete bitcoin_cs_CZ.ts 2012-03-20 09:07:05 +01:00
Philip Kaufmann
603061a7e5 updated english language source file via lupdate 2012-03-19 14:08:41 +01:00
Nils Schneider
4ac3eea027 Merge pull request #953 from Diapolo/master
german translation update
2012-03-19 05:13:08 -07:00
Philip Kaufmann
8afd4699e6 fixed a capitalization error in the german translation 2012-03-19 10:28:10 +01:00
Philip Kaufmann
7c4fabde60 update german translation from transifex 2012-03-19 09:21:11 +01:00
Wladimir J. van der Laan
bd9c6f88be Merge pull request #928 from jojkaart/master
Make send coins dialog honor the configured unit type even on the first attempt.
2012-03-19 01:08:43 -07:00
Matt Corallo
ecf07f2729 Limit getheaders to a hard 2000.
Previously getheaders would return any number of headers up to
2000 + the distance the locator parameter was back (which is up to
~ the number of items in the locator ^ 2).

The only client I was able to find which actually handles the headers
message is BitcoinJ, and it clearly expects no more than 2000 headers
See:
http://code.google.com/p/bitcoinj/source/browse/core/src/main/java/com/google/bitcoin/core/HeadersMessage.java#35

Additionally, the wiki clearly states that getheaders will only ever
return 2000 headers: https://en.bitcoin.it/wiki/Network#Messages
2012-03-19 00:13:15 -04:00
Gregory Maxwell
0b99d1b574 Merge pull request #931 from luke-jr/dbg_loaderr
Wallet loading diagnostic prints to debug.log
2012-03-18 20:11:09 -07:00
Joel Kaartinen
aa3d4c0221 Make the sendcoins dialog use the configured unit type, even on the first attempt. 2012-03-18 23:04:17 +02:00
Alistair Buxton
bb13d056ea When disconnecting a node, clear the received buffer so that we do
not process any already received messages.

The primary reason to do this is if a node spams hundreds of messages
and we ban them, we don't want to continue processing the rest of it.
2012-03-18 03:03:24 +00:00
Philip Kaufmann
652856fb63 update german translation from transifex 2012-03-17 00:48:03 +01:00
Gregory Maxwell
44b69cf25e Bump CLIENT_VERSION for rc4 release 2012-03-16 15:08:57 -04:00
Nils Schneider
98ff031eb8 update translations from transifex 2012-03-16 19:05:25 +01:00
Wladimir J. van der Laan
08ed96d856 Yet another attempt at implementing "minimize to tray" that works on all OSes 2012-03-16 08:17:11 +01:00
Gavin Andresen
e318b99d99 Bump CLIENT_VERSION for rc3 release 2012-03-13 09:31:37 -04:00
Pieter Wuille
d68dcf741e Limit the impact of reorganisations on the database
Sometimes a new block arrives in a new chain that was already the
best valid one, but wasn't marked that way. This happens for example
when network rules change to recover after a fork.

In this case, it is not necessary to do the entire reorganisation
inside a single db commit. These can become huge, and exceed the
objects/lockers limits in bdb. This patch limits the blocks the
actual reorganisation is applied to, and adds the next blocks
afterwards in separate db transactions.
2012-03-12 20:31:56 +01:00
Luke Dashjr
3cc0624932 Print more diagnostic info for the various DB_CORRUPT conditions 2012-03-12 14:01:15 -04:00
Luke Dashjr
21e875c958 Print wallet load errors (to debug.log) 2012-03-11 17:57:47 -04:00
Gregory Maxwell
82a10c8170 Resolves issue #922 - "wallet passphrase timeout of several years doesn't work"
2^31 milliseconds is only about 25 days. Also clamps Sleep() to 10 years,
because it currently sleeps for 0 seconds when the sleep time would cross
2^31 seconds since the epoch. Hopefully boost will be fixed by 2028.
2012-03-10 17:38:37 -05:00
nomnombtc
f8c478c4fb fix typo src/net.cpp 2012-03-05 19:33:24 +01:00
Pieter Wuille
a206b0ea12 Do not allow overwriting unspent transactions (BIP 30)
Introduce the following network rule:
 * a block is not valid if it contains a transaction whose hash
   already exists in the block chain, unless all that transaction's
   outputs were already spent before said block.

Warning: this is effectively a network rule change, with potential
risk for forking the block chain. Leaving this unfixed carries the
same risk however, for attackers that can cause a reorganisation
in part of the network.

Thanks to Russell O'Connor and Ben Reeves.
2012-03-03 18:26:36 +01:00
Gavin Andresen
142e604184 DoS fix for mapOrphanTransactions 2012-02-29 11:46:46 -05:00
Gavin Andresen
722d9387be Merge branch 'mruinventory' of https://github.com/sipa/bitcoin 2012-02-28 11:48:44 -05:00
Gavin Andresen
6dd5ae41ac Merge branch '2012_02_getspecialfolderpath_overflow' of https://github.com/laanwj/bitcoin 2012-02-28 11:45:14 -05:00
Michael Ford
27adfb2e0c "February" 2012-02-28 20:31:56 +08:00
Gavin Andresen
07ed49a472 Do not start bitcoin: thread on OSX. fixes #889 2012-02-27 16:08:08 -05:00
Gavin Andresen
21503e4556 Merge branch 'nodosbip16' of https://github.com/sipa/bitcoin 2012-02-27 15:47:27 -05:00
Pieter Wuille
c4341fa6ab Add mruset and use it for setInventoryKnown 2012-02-27 21:04:32 +01:00
Gavin Andresen
46aa2a6bdd Move BIP16 switchover time to April 1 2012-02-27 11:41:20 -05:00
Gavin Andresen
90d78142c0 Merge branch 'nooptionsinwallet+fixproxysetting' of https://github.com/sipa/bitcoin 2012-02-27 11:30:05 -05:00
Wladimir J. van der Laan
fbbd42a535 Merge pull request #853 from laanwj/2012_02_altminimizetray
Yet another alternative "minimize to tray" implementation

Fixes problems with window positioning.
2012-02-26 22:27:25 -08:00
Pieter Wuille
42c8b56f62 Store addrProxy port in settings 2012-02-26 23:39:32 +01:00
Gavin Andresen
3f8cb2c565 Reworked QT settings 2012-02-26 23:38:28 +01:00
Gavin Andresen
972060ce0e bitcoind changes to stop storing settings in wallet.dat. 2012-02-26 23:21:33 +01:00
Wladimir J. van der Laan
21ae37d215 Simplify MyGetSpecialFolderPath and fix possible buffer overflow (#901) 2012-02-26 17:11:38 +01:00
Pieter Wuille
88c41c43ea Move 'Backup Wallet' to file menu 2012-02-26 03:04:25 +01:00
Pieter Wuille
4a10d4c6dc Fix addrProxy setting
Before 0.6 addrProxy was a CAddress, but netbase changed it to CService.
Retain compatibility by wrapping/unwrapping with a CAddress when saving
or loading.

This commit retains compatibility with 0.6.0rc1 (which wrote the setting
as a CService) by trying to parse twice.
2012-02-25 21:13:34 +01:00
Wladimir J. van der Laan
da9ab62fb7 Merge pull request #897 from laanwj/2012_02_fixnegativesecs
In UI, handle cases in which the last received block was generated in the future
2012-02-25 10:14:37 -08:00
Wladimir J. van der Laan
71ba9abba6 In UI, handle cases in which the last received block was generated in the future (secs<0)
Fixes #874.
2012-02-25 19:11:25 +01:00
Pieter Wuille
db9f2e0117 Do not invoke anti-DoS system for invalid BIP16 transactions
Doing so would allow an attack on old nodes, which would relay a
standard transaction spending a BIP16 output in an invalid way,
until reaching a new node, which will disconnect their peer.

Reported by makomk on IRC.
2012-02-25 19:05:50 +01:00
Chris Moore
ec4efde40c Add option "-splash" so we can disable the splash screen.
Don't show splash screen when -min is specified on the command line.
2012-02-24 19:17:22 -08:00
Pieter Wuille
5fee401fe1 CAddrMan: stochastic address manager
Design goals:
 * Only keep a limited number of addresses around, so that addr.dat does not grow without bound.
 * Keep the address tables in-memory, and occasionally write the table to addr.dat.
 * Make sure no (localized) attacker can fill the entire table with his nodes/addresses.

See comments in addrman.h for more detailed information.
2012-02-24 13:41:04 +01:00
Gavin Andresen
8c12851ed4 Checkpoint block 168,000 2012-02-23 13:33:30 -05:00
Gavin Andresen
fc4f4c2e9a Merge branch 'getblock_cleanup' of https://github.com/luke-jr/bitcoin 2012-02-23 12:41:26 -05:00
Luke Dashjr
34f8788915 Cleanup JSON-RPC getblock output to be consistent
- Add "size" and "bits"
- Rename "blockcount" to "height"
- Rename "hashprevious" and "hashnext" to "previousblockhash" and "nextblockhash" (respectively)
2012-02-22 12:31:28 -05:00
Gavin Andresen
5c03282521 Merge branch 'testnetirc' of https://github.com/sipa/bitcoin 2012-02-22 11:26:19 -05:00
Gavin Andresen
6fe8c45375 Merge branch 'fixnullpfrom' of https://github.com/sipa/bitcoin 2012-02-22 11:25:08 -05:00
Gavin Andresen
e7e6ae2104 Merge branch 'postfeb20' of https://github.com/sipa/bitcoin 2012-02-22 11:06:44 -05:00