Commit graph

1425 commits

Author SHA1 Message Date
Jeff Garzik 9c137aaccf BDB: restore DB_PRIVATE flag to environment
Satoshi's commits fdbf76d and c8ad9b8 (SVN import) removed the
DB_PRIVATE flag from the environment.  In part, this enables processes
other than bitcoind to examine the active database environment.

However, this incurs a slight performance penalty versus working
entirely within application memory (DB_PRIVATE).  Because bitcointools
and other direct-BDB-accessing tools are not used by the vast
majority of users, prefer to default with DB_PRIVATE with the option
of disabling it if needed via -privdb=0.
2012-05-21 12:38:45 -04:00
Pieter Wuille 46784d0826 Merge pull request #1354 from fanquake/master
Update Header Licenses
2012-05-20 12:27:50 -07:00
Pieter Wuille 6e86c4700b Merge pull request #1363 from Diapolo/remove_strncasecmp
remove strncasecmp() + strnicmp() calls use boost::algorithm::istarts_with()
2012-05-20 12:26:43 -07:00
Philip Kaufmann 4dfbc78a88 start rows in askpassphrasedialog.ui at 0 (not 1) 2012-05-20 15:55:39 +02:00
Wladimir J. van der Laan 239c11d0dd Make testcases build, prevent windows symbol collision 2012-05-20 10:44:50 +02:00
Wladimir J. van der Laan 0832c0d166 Process address book updates incrementally
- No longer invalidates selection model, thus retains selection on address book changes
- Fixes selection of new address when added
2012-05-20 10:44:50 +02:00
Wladimir J. van der Laan ab1b288fa7 Convert UI interface to boost::signals2.
- Signals now go directly from the core to WalletModel/ClientModel.
  - WalletModel subscribes to signals on CWallet: Prepares for multi-wallet support, by no longer assuming an implicit global wallet.
- Gets rid of noui.cpp, the few lines that were left are merged into init.cpp
- Rename wxXXX message flags to MF_XXX, to make them UI indifferent.
- ThreadSafeMessageBox no longer returns the value `4` which was never used, converted to void.
2012-05-20 10:44:50 +02:00
Wladimir J. van der Laan fe4a655042 Fine-grained UI updates
Gets rid of `MainFrameRepaint` in favor of specific update functions that tell the UI exactly what changed.

This improves the efficiency of various handlers. Also fixes problems with mined transactions not showing up until restart.

The following notifications were added:

- `NotifyBlocksChanged`: Block chain changed
- `NotifyKeyStoreStatusChanged`: Wallet status (encrypted, locked) changed.
- `NotifyAddressBookChanged`: Address book entry changed.
- `NotifyTransactionChanged`: Wallet transaction added, removed or updated.
- `NotifyNumConnectionsChanged`: Number of connections changed.
- `NotifyAlertChanged`: New, updated or cancelled alert. As this finally makes it possible for the UI to know when a new alert arrived, it can be shown as OS notification.

These notifications could also be useful for RPC clients. However, currently, they are ignored in bitcoind (in noui.cpp).

Also brings back polling with timer for numBlocks in ClientModel. This value updates so frequently during initial download that the number of signals clogs the UI thread and causes heavy CPU usage. And after initial block download, the value changes so rarely that a delay of half a second until the UI updates is unnoticable.
2012-05-20 10:41:54 +02:00
Wladimir J. van der Laan 563f3efda3 Merge pull request #1323 from Diapolo/string_fixes
translation updates / string updates
2012-05-20 01:34:06 -07:00
Wladimir J. van der Laan 6f3b919ae1 Merge pull request #1353 from Diapolo/RPC_OpenDebugLog_Icon
GUI: add an icon for Debug logfile -> Open in the RPC console
2012-05-20 01:32:18 -07:00
Wladimir J. van der Laan 01ecb074a7 Merge pull request #1302 from laanwj/2012_05_utilstrings
Get rid of snprintf (except one) with fixed buffers, shorten code
2012-05-20 01:30:18 -07:00
Jeff Garzik ffe8b77a61 Further CDBEnv encapsulation work. 2012-05-19 20:46:52 -04:00
Jeff Garzik 94e34fa0ad CDB::CDB: properly initialize activeTxn to NULL 2012-05-19 20:45:39 -04:00
Jeff Garzik 8b1202c52c Remove unused nested BDB transaction support 2012-05-19 20:45:39 -04:00
Jeff Garzik 24b57e3c6a Create CDBEnv::TxnBegin(), and use it in CDB::TxnBegin() 2012-05-19 20:44:31 -04:00
Jeff Garzik cd9696fc97 Encapsulate BDB environment inside new CDBEnv class
Cleans up and organizes several scattered functions and variables related to
the BDB env.  Class CDBInit() existed to provide a
guaranteed-via-C++-destructor cleanup of the db environment.

A formal CDBEnv class provides all of this inside a single wrapper.
2012-05-19 20:43:19 -04:00
Jeff Garzik b52a270538 Reorganize(): remove spurious TxnAbort()
If Reorganize() fails, then its caller, CBlock::SetBestChain(),
will call TxnAbort().

Redundant TxnAbort() calls are harmless.  The second will return an
error return value, with no other side effects.  TxnAbort() return
values are generally never checked.  The impact is nil.
2012-05-19 20:40:43 -04:00
Philip Kaufmann 00fb08158d remove strncasecmp() + strnicmp() calls and replace that code via boost::algorithm::istarts_with() / do not call ipcInit() on Mac and Windows as this is unneeded currently 2012-05-20 00:48:34 +02:00
Jeff Garzik cde87ee75c Merge pull request #1360 from jgarzik/datasync
Default to DB_TXN_WRITE_NOSYNC for all transactional operations
2012-05-19 12:33:19 -07:00
Pieter Wuille bd795bd543 Merge pull request #1358 from luke-jr/shared_lockchk
Shared code for wallet lock help and check
2012-05-19 08:34:27 -07:00
Gavin Andresen 973ca019bc Merge pull request #1296 from Diapolo/CheckDiskSpace
make CheckDiskSpace() use 50 * 1024 * 1024 Bytes
2012-05-19 05:48:48 -07:00
Gavin Andresen 23e5c5b11a Merge pull request #1289 from Diapolo/Bitcoin_as_noun
change strings to Bitcoin (uppercase), where it is used as a noun and up...
2012-05-19 05:45:50 -07:00
Wladimir J. van der Laan e3f72a3555 Merge pull request #1362 from laanwj/2012_05_debugwindowicon2
Replace debug window icon with LGPL-licensed one (fixes #1348)
2012-05-19 03:48:09 -07:00
Wladimir J. van der Laan 8a6a35e9d9 Replace debug window icon with LGPL-licensed one (fixes #1348) 2012-05-19 12:47:01 +02:00
Jeff Garzik 394b9298fa Default to DB_TXN_WRITE_NOSYNC for all transactional operations
* This is safer than DB_TXN_NOSYNC, and does not appear to impact
  performance.
* Applying this to the dbenv is necessary to avoid many fdatasync(2)
  calls on db 5.x
* We carefully and thoroughly flush databases upon shutdown and
  other important events already.
2012-05-19 01:25:06 -04:00
Luke Dashjr 29875dcb4b Shared code for wallet lock help and check 2012-05-18 23:13:21 +00:00
Michael Hendricks 9af080c351 Reopen debug.log on SIGHUP
The best log rotation method formerly available was to configure
logrotate with the copytruncate option.  As described in the logrotate
documentation, "there is a very small time slice between copying the
file and truncating it, so some logging data might be lost".

By sending SIGHUP to the server process, one can now reopen the debug
log file without losing any data.
2012-05-18 16:20:03 -06:00
Michael Hendricks fea25712ca Serialize access to debug.log stream
Acquire an exclusive, advisory lock before sending output to debug.log
and release it when we're done. This should avoid output from multiple
threads being interspersed in the log file.

We can't use CRITICAL_SECTION machinery for this because the debug log
is written during startup and shutdown when that machinery is not
available.

(Thanks to Gavin for pointing out the CRITICAL_SECTION problems based
on his earlier work in this area)
2012-05-18 16:19:09 -06:00
Philip Kaufmann ff0ee876bb change strings to Bitcoin (uppercase), where it is used as a noun and update strings to use "Qt" (and not qt or QT) / update initialisation of notificator to use qApp->applicationName() instead of a static string 2012-05-18 23:13:58 +02:00
Jeff Garzik d6615a54c6 Merge pull request #1350 from jgarzik/del-deprecated
JSON-RPC: remove 'getblocknumber' deprecated RPC
2012-05-18 08:26:40 -07:00
Pieter Wuille 660ff174f2 Use boost::thread locking instead of interprocess 2012-05-18 16:56:12 +02:00
Gavin Andresen 62922c8ab0 Cache signature verifications
Create a maximum-10MB signature verification result cache.
This should almost double the number of transactions that
can be processed on a given CPU, because before this change
ECDSA signatures were verified when transactions were added
to the memory pool and then again when they appeared in
a block.
2012-05-18 10:41:18 -04:00
Gavin Andresen 4add41a2a6 Further DoS prevention: Verify signatures last
Loop over all inputs doing inexpensive validity checks first,
and then loop over them a second time doing expensive signature
checks. This helps prevent possible CPU exhaustion attacks
where an attacker tries to make a victim waste time checking
signatures for invalid transactions.
2012-05-18 10:41:18 -04:00
Gavin Andresen 7a15109c04 Remove invalid dependent orphans from memory
Remove orphan transactions from memory once
all of their parent transactions are received
and they're still not valid.
Thanks to Sergio Demian Lerner for suggesting this fix.
2012-05-18 10:41:17 -04:00
Gavin Andresen 77b99cf7ad Optimize orphan transaction handling
Changes suggested by Sergio Demian Lerner to
help prevent potential DoS attacks.
2012-05-18 10:13:21 -04:00
Fordy 3a25a2b9b0 Update License in File Headers
I originally created a pull to replace the "COPYING" in crypter.cpp and
crypter.h, but it turned out that COPYING was actually the correct
file.
2012-05-18 22:02:28 +08:00
Philip Kaufmann a3b4caac38 add an icon for Debug logfile -> Open in the RPC console / add a missing comment in rpcconsole.h 2012-05-18 14:11:55 +02:00
Wladimir J. van der Laan 4a9130aca2 Merge pull request #1346 from laanwj/2012_05_overviewpage_restore
Restore overview page (put transactions back within frame)
2012-05-18 01:35:31 -07:00
Wladimir J. van der Laan 320fe1015a Restore overviewpage (put transactions back within frame)
- Also, change "(out of sync)" to only red, instead of red and bold, which a bit more subtle
- Move label stylesheets to xml
2012-05-18 10:33:09 +02:00
Jeff Garzik 47f48a658d JSON-RPC: remove 'getblocknumber' deprecated RPC
RPC 'getblockcount' should be used instead.
2012-05-17 23:43:00 -04:00
Jeff Garzik 6d64a0bfed Make orphan logging more verbose, displaying mapOrphanTransactions.size()
Old log message:
	storing orphan tx df2244f6bc

New log message:
	storing orphan tx df2244f6bc (mapsz 51)

Also, trim a few trailing whitespace in main.cpp.
2012-05-17 20:36:55 -04:00
Jeff Garzik 6c513a45d5 Merge pull request #1340 from rebroad/DBFlushDurationReport
Report how long DBFlush took.
2012-05-17 17:21:01 -07:00
Jeff Garzik f9dd136a09 Revert "use _strnicmp (ISO C++) instead of deprecated strnicmp (POSIX) and add missing "#define strncasecmp _strnicmp" in init.cpp"
This reverts commit f4ac41806a.

Reason: breaks build.
2012-05-17 20:14:24 -04:00
Jeff Garzik c0a360ce49 Merge pull request #1345 from Diapolo/strnicmp_Win32
Win32: use _strnicmp (ISO C++) instead of deprecated strnicmp (POSIX)
2012-05-17 15:53:38 -07:00
R E Broadley 53d0e6dd6a Report how long DBFlush took. 2012-05-17 22:56:14 +01:00
Philip Kaufmann f4ac41806a use _strnicmp (ISO C++) instead of deprecated strnicmp (POSIX) and add missing "#define strncasecmp _strnicmp" in init.cpp 2012-05-17 23:20:47 +02:00
Wladimir J. van der Laan f0fc95a143 Merge pull request #1314 from Diapolo/Wallet_Transaction_state_Overviewpage
GUI: add 2 labels to the overviewpage that display Wallet and Transaction status
2012-05-17 14:13:23 -07:00
R E Broadley 83e047eaa7 Was showing a negative number. Changes to positive, since negative (T minus) usually indicates a future event. 2012-05-17 21:58:05 +01:00
Gavin Andresen f718aedd9f Refactor: GetRandHash() method for util 2012-05-17 16:33:27 -04:00
Gavin Andresen 096e06dbb5 Refactor: move code from key.h to key.cpp 2012-05-17 16:33:26 -04:00
Philip Kaufmann c26f3a9bd1 add 2 labels to the overviewpage that display Wallet and Transaction status (obsolete or current) / cleanup overviewpage XML ui-file 2012-05-17 21:49:32 +02:00
Wladimir J. van der Laan f1e7570755 Merge pull request #1336 from laanwj/2012_05_consoleicon
Add icon for debug window
2012-05-17 11:38:08 -07:00
Wladimir J. van der Laan 8ece75aee1 Add icon for debug window 2012-05-17 20:34:30 +02:00
Jeff Garzik 7563424f32 Merge pull request #1334 from rebroad/Exiting2Exited
Corrected grammar. As per Principle Of Least Surprise.
2012-05-17 11:29:09 -07:00
R E Broadley 1d764d631f Corrected grammar. As per Principle Of Least Surprise. 2012-05-17 18:52:38 +01:00
R E Broadley 8c35bfbadf Add /bin/sh to bitcoin-qt.pro - as some filesystems don't have the execute flag. 2012-05-17 18:48:09 +01:00
Philip Kaufmann 5f9861953e fix RenameOver() and FileCommit() functions, to not generate compilation errors 2012-05-17 18:30:09 +02:00
Jeff Garzik cf2f7c30a3 Merge pull request #1295 from jgarzik/txn-retval
[FIX] Always check return values of TxnBegin() and TxnCommit()
2012-05-17 08:49:16 -07:00
Jeff Garzik d17ac27a72 Merge pull request #1316 from jgarzik/dead-code
Remove dead code: CTxDB::EraseBlockIndex(), CBlockIndex::EraseBlockFromDisk()
2012-05-17 08:47:54 -07:00
Philip Kaufmann 8b4d653663 allow translation of "options" used in the --help message / split translation of RPC console welcome message and remove the need to take care of "<br>" / remove some spaces in strings and misc other stuff related to translations 2012-05-17 15:49:00 +02:00
Jeff Garzik 928d3a011c CAddrDB: Replace BDB-managed addr.dat with internally managed peers.dat 2012-05-16 22:11:19 -04:00
Jeff Garzik 768e5d52fb Add new utility functions FileCommit(), RenameOver() 2012-05-16 19:25:25 -04:00
Wladimir J. van der Laan 49232d1abf Merge pull request #1319 from Diapolo/add_new_languages
add 4 new translations bg, el_GR, fr and pt_PT (based on transifex fetch from today)
2012-05-16 15:48:48 -07:00
Wladimir J. van der Laan adc704563c Add missing Q_OBJECT in bitcoin.cpp
Fixes translating HelpMessageBox strings.
2012-05-16 18:52:14 +02:00
Wladimir J. van der Laan d44ac73925 Merge pull request #1321 from laanwj/2012_05_updatemaintrans
Update bitcoinstrings.cpp and bitcoin_en.ts
2012-05-15 22:27:33 -07:00
Wladimir J. van der Laan 746ea6bd86 Update bitcoinstrings.cpp and bitcoin_en.ts 2012-05-16 07:24:56 +02:00
Philip Kaufmann cd8c905dfe add 4 new translations bg, el_GR, fr and pt_PT (based on transifex fetch from today) 2012-05-15 23:44:49 +02:00
Jeff Garzik a7d45c5a7a Remove dead code: CTxDB::EraseBlockIndex(), CBlockIndex::EraseBlockFromDisk() 2012-05-15 13:36:25 -04:00
Pieter Wuille 385f730f31 Hopefully final fix for the stuck blockchain issue
Immediately issue a "getblocks", instead of a "getdata" (which will
trigger the relevant "inv" to be sent anyway), and only do so when
the previous set of invs led us into a known and attached part of
the block tree.
2012-05-15 17:53:46 +02:00
Philip Kaufmann 34aa3112c8 adapt user-experience from messagepage / move placeholderTexts from XML to source to avoid a problem with Qt < 4.7 / add eventFilter for address field to select text when clicking in / add Clear All button / rework strings 2012-05-15 08:04:51 +02:00
Wladimir J. van der Laan 2643ce97ae Merge pull request #1307 from Diapolo/fix_OpenLogFile
GUI fix: DebugLog file opens twice after clicking "Open" in RPC Console Information tab
2012-05-14 22:18:20 -07:00
Gregory Maxwell 20f19893cb Merge pull request #1262 from Diapolo/no_double_timestamps
no more double timestamps in debug.log
2012-05-14 18:59:28 -07:00
Philip Kaufmann 8892579f8b fix DebugLog file opens twice after clicking "Open" in RPC Console Information tab 2012-05-14 22:26:15 +02:00
Wladimir J. van der Laan bb361cc644 Merge pull request #906 from sje397/ValidateMessage
Add a menu option and dialog to verify a signed message
2012-05-14 11:11:16 -07:00
Wladimir J. van der Laan 7dc04f4091 Merge pull request #1301 from laanwj/2012_05_rpcscrolltoend
RPC console: scroll to the end when user enters a command
2012-05-14 11:05:04 -07:00
Wladimir J. van der Laan 29b79e4c0e Get rid of snprintf (except one) with fixed buffers, shorten code
- Use strprintf or vstrprintf instead of snprintf
2012-05-14 20:01:26 +02:00
Wladimir J. van der Laan 5a060b8dc8 RPC console: scroll to the end when user enters a command
- Ensures that the command and reply is visible
2012-05-14 18:17:12 +02:00
Pieter Wuille 91dace35a1 Do not listen on blocked networks 2012-05-14 17:52:51 +02:00
Pieter Wuille 55bb0cfbb6 Allow binding to the any address, and report failure 2012-05-14 17:52:50 +02:00
Pieter Wuille 0f1707de67 -onlynet instead of -blocknet 2012-05-14 17:52:45 +02:00
Philip Kaufmann 966ae00fe4 make CheckDiskSpace() use a global static const uint64 for checking required disk space and remove 2 ugly spaces from a message string 2012-05-14 14:02:36 +02:00
Jeff Garzik 0fb78eae34 Always check return values of TxnBegin() and TxnCommit() 2012-05-14 01:11:11 -04:00
Pieter Wuille ca81464697 Use getnameinfo() to get canonical IPv6 addresses 2012-05-14 01:41:15 +02:00
Pieter Wuille 09b4e26a44 Really do not consider blocked networks local 2012-05-13 23:50:55 +02:00
Wladimir J. van der Laan 524843af01 Merge pull request #1283 from laanwj/2012_05_prevent_tooltip_infiniteloop
Prevent tooltip filter from ever causing infinite loops
2012-05-13 13:04:20 -07:00
Wladimir J. van der Laan a3957d089a Merge pull request #1288 from Diapolo/sendcoinsdialog_strings
update some strings used as warning messages in sendcoinsdialog.cpp
2012-05-13 12:42:32 -07:00
Wladimir J. van der Laan 5b36c0336f Merge pull request #1284 from laanwj/2012_05_helpmessage
Move help message out of AppInit2
2012-05-13 12:39:35 -07:00
Jeff Garzik 28d257da11 Merge pull request #1287 from sipa/noirc6
Only encode IPv4 addresses in IRC nicks
2012-05-13 11:48:27 -07:00
Philip Kaufmann 51ce20d5da update some strings used as warning messages in sendcoinsdialog.cpp 2012-05-13 20:20:38 +02:00
Wladimir J. van der Laan 9f5b11e6fd Move help message out of AppInit2
- Solves #1278, attempts to address #1049
- Removes \t's from help message that are removed afterwards anyway
- Moves UI-specific command-line options help to UI code
- Moves "-detachdb" out of #ifdef USE_UPNP
2012-05-13 18:41:19 +02:00
Pieter Wuille 1653f97c8f Do not consider blocked networks local 2012-05-13 15:11:51 +02:00
Pieter Wuille 8f737d28a6 Only encode IPv4 addresses in IRC nicks 2012-05-13 15:07:31 +02:00
Pieter Wuille 9fc0a15cd4 Merge pull request #1285 from sipa/initerror
Improve error reporting at startup
2012-05-13 06:01:21 -07:00
Philip Kaufmann 0985816bf6 ensure that no double timestamps show up in the debug.log, by removing manual timestamps from the source (now only -logtimestamps parameter adds timestamps to debug.log) 2012-05-13 14:36:35 +02:00
Pieter Wuille af4006b3f5 Enforce -nodiscover better 2012-05-13 14:22:15 +02:00
Pieter Wuille ac7c7ab99a Improve error reporting at startup 2012-05-13 12:35:39 +02:00
Wladimir J. van der Laan 67d4cbab46 Move GetStartOnSystemStartup and SetStartOnSystemStartup to GUI code 2012-05-13 12:31:28 +02:00
Wladimir J. van der Laan 82f66082b9 Merge pull request #1270 from laanwj/2012_05_overviewpage2
When a transaction is clicked on overview page, focus it on history page
2012-05-13 02:53:25 -07:00
Wladimir J. van der Laan 3986a05c62 Merge pull request #1274 from Diapolo/QR_Code
rename "QR-Code Dialog" to "QR Code Dialog" in qrcodedialog.ui as this spelling is used all over the code
2012-05-13 00:45:20 -07:00
Wladimir J. van der Laan 6da3b29e37 Merge pull request #1275 from Diapolo/askpassphrasedialog
remove string "TextLabel" from warningLabel, as this is unneeded and as ...
2012-05-13 00:40:26 -07:00