Commit graph

180 commits

Author SHA1 Message Date
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
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 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
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
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 344620e953 Merge pull request #1904 from laanwj/2012_10_remove_getorder
remove "checkorder" P2P command
2012-10-25 11:41:22 -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 ac0ad5dc63 Merge pull request #1901 from laanwj/2012_10_remove_strlcpy
get rid of strlcpy.h
2012-10-11 00:39:51 -07: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 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 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 d210f4f5b8 fix -Wformat warnings all over the source 2012-10-01 19:45:42 +02:00
Pieter Wuille 2e3ffb2d82 Remove stack randomization 2012-09-28 21:53:28 +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
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
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
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
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
Wladimir J. van der Laan 4d1d94c56c Rename CreateThread to NewThread
Prevent clash with win32 API symbol
2012-08-29 20:25:37 +02:00
Pieter Wuille af4da4be3d Bugfix: increase score, not port 2012-08-29 02:33:25 +02:00
Pieter Wuille f161a2c211 Fix infinite loops in connection logic 2012-08-22 13:35:33 +02:00
Jeff Garzik f81e6f779b Merge pull request #1632 from luke-jr/spelling
Fix spelling and grammar errors
2012-08-01 10:56:47 -07:00
Luke Dashjr 814efd6f1f Bugfix: Fix a variety of misspellings 2012-08-01 17:49:51 +00:00
Philip Kaufmann e6bc9c35f3 Update Warning-strings to use a standard-format
- ensure warnings always start with "Warning:" and that the first
  character after ":" is written uppercase
- ensure the first sentence in warnings ends with an "!"
- remove unneeded spaces from Warning-strings
- add missing Warning-string translation
- remove a "\n" and replace with untranslatable "<br><br>"
2012-08-01 19:33:32 +02:00
Jeff Garzik 0ecbd46fe7 Merge pull request #1343 from rebroad/MisbehavingDelta
Show when node is misbehaving, not just at the point that it gets banned...
2012-08-01 09:06:57 -07:00
Philip Kaufmann a76552ce47 do not use external IPv4 discovery, when -onlynet="IPv6" 2012-07-20 13:23:02 +02:00
Philip Kaufmann c95d9a9482 fix a comment in net.cpp 2012-07-17 09:53:53 +02:00
Giel van Schijndel 9f46ab62b1 Fix thread names after review
* Fix wrong thread name for wallet *relocking* thread
  - Was named the unlocking thread
 * Use consistent naming

Signed-off-by: Giel van Schijndel <me@mortis.eu>
2012-07-17 01:50:35 +02:00
Giel van Schijndel 96931d6f78 Give threads a recognisable name to aid in debugging
NOTE: These thread names are visible in gdb when using 'info threads'.
      Additionally both 'top' and 'ps' show these names *unless* told to
      display the command-line instead of task name.

Signed-off-by: Giel van Schijndel <me@mortis.eu>
2012-07-17 01:50:35 +02:00
Gregory Maxwell ff20f32338 Reorder dnsseed list, Jeff's seed list is static so put it last.
Because new nodes pull from the first connected node the load
balancing of the first connection is more important than it should
be. This change puts Pieter's seed first, because its probably
the best maintained right now.
2012-07-11 10:55:30 -04:00
Jeff Garzik 3898609304 Merge pull request #1546 from gmaxwell/allowsamenetinbound
Do not consider inbound peers for outbound network group exclusion.
2012-07-03 19:51:08 -07:00
R E Broadley 90c838da9f Show when node is misbehaving, not just at the point that it gets banned. 2012-07-02 21:58:47 +01:00
Gregory Maxwell 19521acfa4 Do not consider inbound peers for outbound network group exclusion.
Bitcoin will not make an outbound connection to a network group
(/16 for IPv4) that it is already connected to. This means that
if an attacker wants good odds of capturing all a nodes outbound
connections he must have hosts on a a large number of distinct
groups.

Previously both inbound and outbound connections were used to
feed this exclusion. The use of inbound connections, which can be
controlled by the attacker, actually has the potential of making
sibyl attacks _easier_: An attacker can start up hosts in groups
which house many honest nodes and make outbound connections to
the victim to exclude big swaths of honest nodes. Because the
attacker chooses to make the outbound connection he can always
beat out honest nodes for the consumption of inbound slots.

At _best_ the old behavior increases attacker costs by a single
group (e.g. one distinct group to use to fill up all your inbound
slots), but at worst it allows the attacker to select whole
networks you won't connect to.

This commit makes the nodes use only outbound links to exclude
network groups for outbound connections. Fancier things could
be done, like weaker exclusion for inbound groups... but
simplicity is good and I don't believe more complexity is
currently needed.
2012-07-01 20:42:47 -04:00
Matt Corallo 3c3cb60a90 Remove useless high-volume printf (fixes #1544). 2012-07-01 04:13:00 +02:00
Jeff Garzik 1006f0707e RPC: add 'getpeerinfo', returning easy-to-retrieve per-CNode data 2012-06-29 17:24:53 -04:00
Matt Corallo 9d6cd04b3b Stop processing messages on full send buffer and dont disconnect.
Also decrease default send/receive buffer sizes from 10 to 5 mb
as this patch makes it easy for a node to fill both instead of
only send.
2012-06-27 15:31:34 +02:00
Pieter Wuille 863e995b79 Debug version messages 2012-06-23 01:11:38 +02:00
Pieter Wuille 54ce3bad64 Add -tor and related configuration 2012-06-23 01:11:38 +02:00
Philip Kaufmann 9247134eab introduce a new StartShutdown() function, which starts a thread with Shutdown() if no GUI is used and calls uiInterface.QueueShutdown() if a GUI is used / all direct uiInterface.QueueShutdown() calls are replaced with Shutdown() - this ensures a clean GUI shutdown, even when catching a SIGTERM and allows the BitcoinGUI destructor to get called (which fixes a tray-icon issue and keeps the tray-icon until Bitcoin-Qt exits) 2012-06-12 07:21:03 +02:00
Pieter Wuille 587f929c64 Rework network config settings 2012-05-31 18:12:35 +02:00
Gregory Maxwell 7a99821377 Merge pull request #1342 from rebroad/LastSeenMinusMinus
Should not be T minus, as this indicate duration to future event.
2012-05-22 20:33:35 -07:00
Pieter Wuille 46784d0826 Merge pull request #1354 from fanquake/master
Update Header Licenses
2012-05-20 12:27:50 -07: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
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
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