aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
AgeCommit message (Collapse)Author
2016-04-15Merge #7856: Only send one GetAddr response per connection.Wladimir J. van der Laan
66b0724 Only send one GetAddr response per connection. (Gregory Maxwell)
2016-04-14Change mapRelay to store CTransactionsPieter Wuille
2016-04-11Use txid as key in mapAlreadyAskedForSuhas Daftuar
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).
2016-04-11Only send one GetAddr response per connection.Gregory Maxwell
This conserves resources from abusive peers that just send getaddr in a loop. Also makes correlating addr messages against INVs less effective.
2016-03-21Implement "feefilter" P2P message.Alex Morcos
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.
2016-02-17Remove vfReachable and modify IsReachable to only use vfLimited.Patrick Strateman
We do not know that a class of Network is reachable, only that it is not.
2016-02-12fix spelling of advertise in src and docjloughry
2016-02-04Fix spelling: misbeha{b,v}ingMatt
2016-01-05Merge pull request #7205Wladimir J. van der Laan
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)
2015-12-13Bump copyright headers to 2015MarcoFalke
2015-12-11Replace trickle nodes with per-node/message Poisson delaysPieter Wuille
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.
2015-12-07log bytes recv/sent per commandJonas Schnelli
2015-12-03Merge pull request #7133Wladimir J. van der Laan
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)
2015-12-01Merge pull request #7079Wladimir J. van der Laan
ebb25f4 Limit setAskFor and retire requested entries only when a getdata returns. (Gregory Maxwell) 5029698 prevent peer flooding request queue for an inv (kazcw)
2015-11-30Only use filterInventoryKnown with MSG_TX inventory messages.Patick Strateman
Previously this logic could erroneously filter a MSG_BLOCK inventory message.
2015-11-30Rename setInventoryKnown filterInventoryKnownPatick Strateman
2015-11-30Remove mruset as it is no longer used.Gregory Maxwell
2015-11-30Replace setInventoryKnown with a rolling bloom filter.Gregory Maxwell
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.)
2015-11-29Allow block announcements with headersSuhas Daftuar
This replaces using inv messages to announce new blocks, when a peer requests (via the new "sendheaders" message) that blocks be announced with headers instead of inv's. Since headers-first was introduced, peers send getheaders messages in response to an inv, which requires generating a block locator that is large compared to the size of the header being requested, and requires an extra round-trip before a reorg can be relayed. Save time by tracking headers that a peer is likely to know about, and send a headers chain that would connect to a peer's known headers, unless the chain would be too big, in which case we revert to sending an inv instead. Based off of @sipa's commit to announce all blocks in a reorg via inv, which has been squashed into this commit. Rebased-by: Pieter Wuille
2015-11-28Constrain constant values to a single location in codeLuke Dashjr
2015-11-23Limit setAskFor and retire requested entries only when a getdata returns.Gregory Maxwell
The setAskFor duplicate elimination was too eager and removed entries when we still had no getdata response, allowing the peer to keep INVing and not responding.
2015-11-23prevent peer flooding request queue for an invkazcw
mapAlreadyAskedFor does not keep track of which peer has a request queued for a particular tx. As a result, a peer can blind a node to a tx indefinitely by sending many invs for the same tx, and then never replying to getdatas for it. Each inv received will be placed 2 minutes farther back in mapAlreadyAskedFor, so a short message containing 10 invs would render that tx unavailable for 20 minutes. This is fixed by disallowing a peer from having more than one entry for a particular inv in mapAlreadyAskedFor at a time.
2015-11-20Add relaytxes status to getpeerinfoPeter Todd
2015-11-14Fix fRelayTxs commentPatick Strateman
2015-11-14Add help text for blocksonly and whitelistalwaysrelayPatick Strateman
2015-11-12[net] Cleanup maxuploadtargetMarcoFalke
* log: nMaxOutboundLimit is in bytes * log: Hide misleading -maxuploadtarget=0 warning * qa : Minor cleanup to maxuploadtarget rpc tests * net: Use DEFAULT_MAX_UPLOAD_TARGET = 0
2015-11-12torcontrol improvements and fixesWladimir J. van der Laan
- Force AUTHCOOKIE size to be 32 bytes: This provides protection against an attack where a process pretends to be Tor and uses the cookie authentication method to nab arbitrary files such as the wallet - torcontrol logging - fix cookie auth - add HASHEDPASSWORD auth, fix fd leak when fwrite() fails - better error reporting when cookie file is not ok - better init/shutdown flow - stop advertizing service when disconnected from tor control port - COOKIE->SAFECOOKIE auth
2015-10-26Introduce -maxuploadtargetJonas Schnelli
* -maxuploadtarget can be set in MiB * if <limit> - ( time-left-in-24h-cycle / 600 * MAX_BLOCK_SIZE ) has reach, stop serve blocks older than one week and filtered blocks * no action if limit has reached, no guarantee that the target will not be surpassed * add outbound limit informations to rpc getnettotals
2015-09-03Report minimum ping time in getpeerinfoMatt Corallo
2015-08-22Remove redundant whiteconnections optionPatrick Strateman
2015-08-22Record nMinPingUsecTimePatrick Strateman
2015-08-10typofixes (found by misspell_fixer)Veres Lajos
2015-08-05Merge pull request #6462Wladimir J. van der Laan
7b79cbd limit total length of user agent comments (Pavol Rusnak) 557f8ea implement uacomment config parameter which can add comments to user agent as per BIP-0014 (Pavol Rusnak)
2015-08-05limit total length of user agent commentsPavol Rusnak
Reworked-By: Wladimir J. van der Laan <laanwj@gmail.com>
2015-08-03Consolidate individual references to the current maximum peer connectionMatt Quinn
value of 125 into a single constant declaration.
2015-07-23Includes: Cleanup around net main and walletJorge Timón
-Move from .h to .cpp: in main, net and wallet -Remove unnecessary #include "main.h" -Cleanup some wallet files includes
2015-07-10Merge pull request #5288Wladimir J. van der Laan
e3cae52 Added -whiteconnections=<n> option (Josh Lehan)
2015-07-02use CBanEntry as object container for banned nodesJonas Schnelli
- added a reason enum for a ban - added creation time for a ban Using CBanEntry as container will keep banlist.dat extenable.
2015-07-02banlist.dat: store banlist on diskJonas Schnelli
2015-06-17setban: rewrite to UniValue, allow absolute bantimeJonas Schnelli
2015-06-17[RPC] extend setban to allow subnetsJonas Schnelli
2015-06-17[net] remove unused return type bool from CNode::Ban()Jonas Schnelli
2015-06-17[net] extend core functionallity for ban/unban/listbanJonas Schnelli
2015-06-14Added -whiteconnections=<n> optionJosh Lehan
This sets aside a number of connection slots for whitelisted peers, useful for ensuring your local users and miners can always get in, even if your limit on inbound connections has already been reached.
2015-06-04use const references where appropriatePhilip Kaufmann
2015-05-14Use CScheduler for net's DumpAddressesGavin Andresen
Instead of starting Yet Another Thread to dump addresses, use CScheduler to do it.
2015-05-04Merge pull request #6085Wladimir J. van der Laan
b05a89b Non-grammatical language improvements (Luke Dashjr) 7e6d23b Bugfix: Grammar fixes (Corinne Dashjr)
2015-05-01Bugfix: Grammar fixesCorinne Dashjr
2015-04-30Replace mruset setAddrKnown with CRollingBloomFilter addrKnownGavin Andresen
Use a probabilistic bloom filter to keep track of which addresses we think we have given our peers, instead of a list. This uses much less memory, at the cost of sometimes failing to relay an address to a peer-- worst case if the bloom filter happens to be as full as it gets, 1-in-1,000. Measured memory usage of a full mruset setAddrKnown: 650Kbytes Constant memory usage of CRollingBloomFilter addrKnown: 37Kbytes. This will also help heap fragmentation, because the 37K of storage is allocated when a CNode is created (when a connection to a peer is established) and then there is no per-item-remembered memory allocation. I plan on testing by restarting a full node with an empty peers.dat, running a while with -debug=addrman and -debug=net, and making sure that the 'addr' message traffic out is reasonable. (suggestions for better tests welcome)
2015-03-12Merge pull request #5859Wladimir J. van der Laan
9519a9a Add correct bool combiner for net signals (Pieter Wuille)