Commit graph

2504 commits

Author SHA1 Message Date
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
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