aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge #7906: net: prerequisites for p2p encapsulation changesWladimir J. van der Laan2016-05-181-129/+116
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 5d5e7a0 net: No need to export ConnectNode (Cory Fields) e9ed620 net: No need to export DumpBanlist (Cory Fields) 8b8f877 net: make Ban/Unban/ClearBan functionality consistent (Cory Fields) cca221f net: Drop CNodeRef for AttemptToEvictConnection (Cory Fields) 563f375 net: use the exposed GetNodeSignals() rather than g_signals directly (Cory Fields) 9faa490 net: remove unused set (Cory Fields) 52cbce2 net: don't import std namespace (Cory Fields)
| * | net: No need to export DumpBanlistCory Fields2016-05-101-20/+20
| | |
| * | net: make Ban/Unban/ClearBan functionality consistentCory Fields2016-05-101-12/+32
| | | | | | | | | | | | | | | | | | | | | | | | - Ban/Unban/ClearBan call uiInterface.BannedListChanged() as necessary - Ban/Unban/ClearBan sync to disk if the operation is user-invoked - Mark node for disconnection automatically when banning - Lock cs_vNodes while setting disconnected - Don't spin in a tight loop while setting disconnected
| * | net: Drop CNodeRef for AttemptToEvictConnectionCory Fields2016-05-051-53/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Locking for each operation here is unnecessary, and solves the wrong problem. Additionally, it introduces a problem when cs_vNodes is held in an owning class, to which invididual CNodeRefs won't have access. These should be weak pointers anyway, once vNodes contain shared pointers. Rather than using a refcounting class, use a 3-step process instead. 1. Lock vNodes long enough to snapshot the fields necessary for comparing 2. Unlock and do the comparison 3. Re-lock and mark the resulting node for disconnection if it still exists
| * | net: use the exposed GetNodeSignals() rather than g_signals directlyCory Fields2016-05-051-3/+3
| | |
| * | net: remove unused setCory Fields2016-05-051-10/+0
| | |
| * | net: don't import std namespaceCory Fields2016-05-051-32/+31
| | | | | | | | | | | | | | | This file is about to be broken up into chunks and moved around. Drop the namespace now rather than requiring other files to use it.
* | | Merge #7696: Fix de-serialization bug where AddrMan is left corruptedPieter Wuille2016-05-171-0/+8
|\ \ \ | | | | | | | | | | | | 1475ecf Fix de-serialization bug where AddrMan is corrupted after exception * CAddrDB modified so that when de-serialization code throws an exception Addrman is reset to a clean state * CAddrDB modified to make unit tests possible * Regression test created to ensure bug is fixed * StartNode modifed to clear adrman if CAddrDB::Read returns an error code. (EthanHeilman)
| * | | Fix de-serialization bug where AddrMan is corrupted after exceptionEthanHeilman2016-05-041-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * CAddrDB modified so that when de-serialization code throws an exception Addrman is reset to a clean state * CAddrDB modified to make unit tests possible * Regression test created to ensure bug is fixed * StartNode modifed to clear adrman if CAddrDB::Read returns an error code.
* | | | Remove unneeded feerate param from RelayTransaction/AcceptToMemoryPool.Gregory Maxwell2016-05-161-1/+1
| |_|/ |/| |
* | | don't run ThreadMessageHandler at lowered priorityKaz Wesley2016-05-051-1/+0
| |/ |/| | | | | | | There's no clear reason ThreadMessageHandler should be low priority. Fixes #8010 (priority inversion).
* | Merge #7840: Several performance and privacy improvements to inv/mempool ↵Wladimir J. van der Laan2016-05-051-14/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | handling b559914 Move bloom and feerate filtering to just prior to tx sending. (Gregory Maxwell) 4578215 Return mempool queries in dependency order (Pieter Wuille) ed70683 Handle mempool requests in send loop, subject to trickle (Pieter Wuille) dc13dcd Split up and optimize transaction and block inv queues (Pieter Wuille) f2d3ba7 Eliminate TX trickle bypass, sort TX invs for privacy and priority. (Gregory Maxwell)
| * | Move bloom and feerate filtering to just prior to tx sending.Gregory Maxwell2016-04-211-14/+1
| | | | | | | | | | | | | | | | | | | | | This will avoid sending more pointless INVs around updates, and prevents using filter updates to timetag transactions. Also adds locking for fRelayTxes.
| * | Handle mempool requests in send loop, subject to tricklePieter Wuille2016-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | | By eliminating queued entries from the mempool response and responding only at trickle time, this makes the mempool no longer leak transaction arrival order information (as the mempool itself is also sorted)-- at least no more than relay itself leaks it.
* | | Merge #7974: More comments on the design of AttemptToEvictConnection.Wladimir J. van der Laan2016-05-041-2/+11
|\ \ \ | | | | | | | | | | | | d90351f More comments on the design of AttemptToEvictConnection. (Gregory Maxwell)
| * | | More comments on the design of AttemptToEvictConnection.Gregory Maxwell2016-04-291-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some developers clearly don't get this and have been posting "improvements" that create clear vulnerabilities. It should have been better explained in the code, since the design is somewhat subtle and getting it right is important.
* | | | fix race that could fail to persist a banKaz Wesley2016-04-271-2/+3
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DumpBanList currently does this: - with lock: take a copy of the banmap - perform I/O (write out the banmap) - with lock: mark the banmap non-dirty If a new ban is added during the I/O operation, it may never be persisted to disk. Reorder operations so that the data to be persisted cannot be older than the time at which the banmap was marked non-dirty.
* | | net: manually resolve dns seed sourcesCory Fields2016-04-201-1/+9
| | | | | | | | | | | | | | | | | | | | | Note: Some seeds aren't actually returning an IP for their name entries, so they're being added to addrman with a source of [::]. This commit shouldn't change that behavior, for better or worse.
* | | net: require lookup functions to specify all argumentsCory Fields2016-04-171-2/+2
|/ / | | | | | | To make it clear where DNS resolves are happening
* | Merge #7856: Only send one GetAddr response per connection.Wladimir J. van der Laan2016-04-151-0/+1
|\ \ | | | | | | | | | 66b0724 Only send one GetAddr response per connection. (Gregory Maxwell)
| * | Only send one GetAddr response per connection.Gregory Maxwell2016-04-111-0/+1
| | | | | | | | | | | | | | | | | | This conserves resources from abusive peers that just send getaddr in a loop. Also makes correlating addr messages against INVs less effective.
* | | Change mapRelay to store CTransactionsPieter Wuille2016-04-141-13/+4
| | |
* | | Use txid as key in mapAlreadyAskedForSuhas Daftuar2016-04-111-3/+3
|/ / | | | | | | | | | | | | Previously we used the CInv that would be sent to the peer announcing the transaction as the key, but using the txid instead allows us to decouple the p2p layer from the application logic (which relies on this map to avoid duplicate tx requests).
* | Implement "feefilter" P2P message.Alex Morcos2016-03-211-8/+12
| | | | | | | | The "feefilter" p2p message is used to inform other nodes of your mempool min fee which is the feerate that any new transaction must meet to be accepted to your mempool. This will allow them to filter invs to you according to this feerate.
* | Remove vfReachable and modify IsReachable to only use vfLimited.Patrick Strateman2016-02-171-11/+1
| | | | | | | | We do not know that a class of Network is reachable, only that it is not.
* | fix spelling of advertise in src and docjloughry2016-02-121-2/+2
|/
* Merge #7192: Unify product name to as few places as possibleWladimir J. van der Laan2016-02-041-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 027fdb8 When/if the copyright line does not mention Bitcoin Core developers, add a second line to copyrights in -version, About dialog, and splash screen (Luke Dashjr) cc2095e Rewrite FormatParagraph to handle newlines within input strings correctly (Luke Dashjr) cddffaf Bugfix: Include COPYRIGHT_HOLDERS_SUBSTITUTION in Makefile substitutions so it gets passed to extract-strings correctly (Luke Dashjr) 29598e4 Move PACKAGE_URL to configure.ac (Luke Dashjr) 78ec83d splashscreen: Resize text to fit exactly (Luke Dashjr) 3cae140 Bugfix: Actually use _COPYRIGHT_HOLDERS_SUBSTITUTION everywhere (Luke Dashjr) 4d5a3df Bugfix: gitian-descriptors: Add missing python-setuptools requirement for OS X (biplist module) (Luke Dashjr) e4ab5e5 Bugfix: Correct copyright year in Mac DMG background image (Luke Dashjr) 917b1d0 Set copyright holders displayed in notices separately from the package name (Luke Dashjr) c39a6ff Travis & gitian-osx: Use depends for ds_store and mac_alias modules (Luke Dashjr) 902ccde depends: Add mac_alias to depends (Luke Dashjr) 82a2d98 depends: Add ds_store to depends (Cory Fields) de619a3 depends: Pass PYTHONPATH along to configure (Cory Fields) e611b6e macdeploy: Use rsvg-convert rather than cairosvg (Luke Dashjr) 63bcdc5 More complicated package name substitution for Mac deployment (Luke Dashjr) 1a6c67c Parameterise 2009 in translatable copyright strings (Luke Dashjr) d5f4683 Unify package name to as few places as possible without major changes (Luke Dashjr)
| * Merge branch 'master' into single_prodnameLuke Dashjr2016-02-031-50/+85
| |\
| * | Unify package name to as few places as possible without major changesLuke Dashjr2015-12-141-1/+1
| | |
* | | Merge #7458: [Net] peers.dat, banlist.dat recreated when missingWladimir J. van der Laan2016-02-041-2/+7
|\ \ \ | |_|/ |/| | | | | c77c662 peers.dat, banlist.dat recreated when missing (kirkalx)
| * | peers.dat, banlist.dat recreated when missingkirkalx2016-02-041-2/+7
| | |
* | | Decide eviction group ties based on time.Gregory Maxwell2016-02-011-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This corrects a bug the case of tying group size where the code may fail to select the group with the newest member. Since newest time is the final selection criteria, failing to break ties on it on the step before can undermine the final selection. Tied netgroups are very common. (cherry picked from commit 8e09f914f8ec66301257358b250e9a61befadd95)
* | | Do not absolutely protect local peers from eviction.Gregory Maxwell2016-02-011-2/+0
|/ / | | | | | | | | | | | | | | | | With automatic tor HS support in place we should probably not be providing absolute protection for local peers, since HS inbound could be used to attack pretty easily. Instead, this counts on the latency metric inside AttemptToEvictConnection to privilege actually local peers. (cherry picked from commit 46dbcd4833115401fecbb052365b4c7725874414)
* | Merge #7350: Banlist updatesWladimir J. van der Laan2016-01-201-24/+30
|\ \ | | | | | | | | | | | | | | | | | | e8600c9 banlist (bugfix): allow CNode::SweepBanned() to run on interval (Philip Kaufmann) 2977c24 banlist: add more banlist infos to log / add GUI signal (Philip Kaufmann) ce479aa banlist: better handling of banlist in StartNode() (Philip Kaufmann) 57c77fe banlist: update set dirty to be more fine grained (Philip Kaufmann)
| * \ Merge branch 'master' into 20150703_banlist_updatesLuke Dashjr2016-01-151-18/+161
| |\ \
| * | | banlist (bugfix): allow CNode::SweepBanned() to run on intervalPhilip Kaufmann2015-10-021-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | - allows CNode::SweepBanned() to run, even if !CNode::BannedSetIsDirty(), because if nBanUntil is over we want the ban to be disabled for these nodes
| * | | banlist: add more banlist infos to log / add GUI signalPhilip Kaufmann2015-10-021-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - to match the peers.dat handling also supply a debug.log entry for how many entries were loaded from banlist.dat and how long it took - add a GUI init message for loading the banlist (same as with peers.dat) - move the same message for peers.dat upwards in the code, to be able to reuse the timing variable nStart and also just log, if our read from peers.dat didn't fail
| * | | banlist: better handling of banlist in StartNode()Philip Kaufmann2015-10-021-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - only start working on/with banlist data, if reading in the banlist from disk didn't fail - as CNode::setBannedIsDirty is false (default) when reading fails, we don't need to explicitly set it to false to prevent writing banlist.dat in that case either
| * | | banlist: update set dirty to be more fine grainedPhilip Kaufmann2015-10-021-7/+4
| | | | | | | | | | | | | | | | | | | | - move the SetBannedSetDirty(false) call from DumpData() into DumpBanlist() - ensure we only set false, if the write succeeded
* | | | Typo fixes in commentsChris Wheeler2016-01-171-1/+1
| |/ / |/| |
* | | Merge pull request #7205Wladimir J. van der Laan2016-01-051-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | fa71669 [devtools] Use git pretty-format for year parsing (MarcoFalke) fa24439 Bump copyright headers to 2015 (MarcoFalke) fa6ad85 [devtools] Rewrite fix-copyright-headers.py (MarcoFalke)
| * | | Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
| | | |
* | | | Double semicolon cleanup.21E142015-12-301-1/+1
| | | |
* | | | Replace trickle nodes with per-node/message Poisson delaysPieter Wuille2015-12-111-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to have a trickle node, a node which was chosen in each iteration of the send loop that was privileged and allowed to send out queued up non-time critical messages. Since the removal of the fixed sleeps in the network code, this resulted in fast and attackable treatment of such broadcasts. This pull request changes the 3 remaining trickle use cases by random delays: * Local address broadcast (while also removing the the wiping of the seen filter) * Address relay * Inv relay (for transactions; blocks are always relayed immediately) The code is based on older commits by Patrick Strateman.
* | | | net: Add and document network messages in protocol.hWladimir J. van der Laan2015-12-101-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Avoids string typos (by making the compiler check) - Makes it easier to grep for handling/generation of a certain message type - Refer directly to documentation by following the symbol in IDE - Move list of valid message types to protocol.cpp: protocol.cpp is a more appropriate place for this, and having the array there makes it easier to keep things consistent.
* | | | net: Account for `sendheaders` `verack` messagesWladimir J. van der Laan2015-12-071-1/+2
| | | | | | | | | | | | | | | | Looks like these were forgotten in #6589.
* | | | log bytes recv/sent per commandJonas Schnelli2015-12-071-1/+27
| | | |
* | | | Merge pull request #7133Wladimir J. van der Laan2015-12-031-1/+2
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | aa4b0c2 When not filtering blocks, getdata sends more in one test (Pieter Wuille) d41e44c Actually only use filterInventoryKnown with MSG_TX inventory messages. (Gregory Maxwell) b6a0da4 Only use filterInventoryKnown with MSG_TX inventory messages. (Patick Strateman) 6b84935 Rename setInventoryKnown filterInventoryKnown (Patick Strateman) e206724 Remove mruset as it is no longer used. (Gregory Maxwell) ec73ef3 Replace setInventoryKnown with a rolling bloom filter. (Gregory Maxwell)
| * | | Rename setInventoryKnown filterInventoryKnownPatick Strateman2015-11-301-2/+2
| | | |
| * | | Replace setInventoryKnown with a rolling bloom filter.Gregory Maxwell2015-11-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mruset setInventoryKnown was reduced to a remarkably small 1000 entries as a side effect of sendbuffer size reductions in 2012. This removes setInventoryKnown filtering from merkleBlock responses because false positives there are especially unattractive and also because I'm not sure if there aren't race conditions around the relay pool that would cause some transactions there to be suppressed. (Also, ProcessGetData was accessing setInventoryKnown without taking the required lock.)