aboutsummaryrefslogtreecommitdiff
path: root/src/addrman.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Always use a 50% chance to choose between tried and new entriesPieter Wuille2015-06-271-5/+3
| | | | | | | | | | This change was suggested as Countermeasure 2 in Eclipse Attacks on Bitcoin’s Peer-to-Peer Network, Ethan Heilman, Alison Kendler, Aviv Zohar, Sharon Goldberg. ePrint Archive Report 2015/263. March 2015. Rebased-From: c6a63ceeb4956933588995bcf01dc3095aaeb1fc Github-Pull: #5941
* Do not bias outgoing connections towards fresh addressesPieter Wuille2015-06-271-2/+0
| | | | | | | | | | This change was suggested as Countermeasure 2 in Eclipse Attacks on Bitcoin’s Peer-to-Peer Network, Ethan Heilman, Alison Kendler, Aviv Zohar, Sharon Goldberg. ePrint Archive Report 2015/263. March 2015. Rebased-From: 68ba3f67bd500a64fb8932c6b41924ddc31d76f Github-Pull: #5941
* Simplify hashing codePieter Wuille2015-06-271-21/+5
| | | | | | | | Conflicts: src/addrman.cpp Rebased-From: a8ff7c62edc63c7c94bc91c30b80995539ed7477 Github-Pull: #5941
* Make addrman's bucket placement deterministic.Pieter Wuille2015-06-271-167/+130
| | | | | | | | | | | | | | | | | | | | | | Give each address a single fixed location in the new and tried tables, which become simple fixed-size arrays instead of sets and vectors. This prevents attackers from having an advantages by inserting an address multiple times. This change was suggested as Countermeasure 1 in Eclipse Attacks on Bitcoin’s Peer-to-Peer Network, Ethan Heilman, Alison Kendler, Aviv Zohar, Sharon Goldberg. ePrint Archive Report 2015/263. March 2015. It is also more efficient. Rebased-From: e6b343d880f50d52390c5af8623afa15fcbc65a2 Github-Pull: #5941 Conflicts: src/addrman.cpp src/addrman.h
* Switch addrman key from vector to uint256Pieter Wuille2015-06-271-6/+8
| | | | | | | | Conflicts: src/addrman.cpp Rebased-From: b23add5521e4207085d41a0266617e94435fc22e Github-Pull: #5941
* Reduce fingerprinting through timestamps in 'addr' messages.Pieter Wuille2015-06-271-1/+2
| | | | | | | Suggested by Jonas Nick. Rebased-From: 9c2737901b5203f267d21d728019d64b46f1d9f3 Github-Pull: #5860
* Remove redundant .c_str()sWladimir J. van der Laan2014-01-231-1/+1
| | | | | | | After the tinyformat switch sprintf() family functions support passing actual std::string objects. Remove unnecessary c_str calls (236 of them) in logging and formatting.
* Changed Get64(.) to GetLow64()Thomas Holenstein2013-12-251-4/+4
| | | | | | | The function Get64(.) has a bug in case the width is not divisible by 64. Since it is only ever used as Get64(0) this simply changes it to this special case. Additionally, an assert is added, and a cast to prevent a compiler error.
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-17/+19
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* Replace printf with LogPrintf / LogPrintGavin Andresen2013-09-181-4/+1
|
* Split off hash.h from util.hPieter Wuille2012-12-181-0/+1
|
* Trim trailing whitespace for src/*.{h,cpp}Jeff Garzik2012-09-181-2/+2
|
* fix a comment in addrman.cppPhilip Kaufmann2012-08-181-1/+1
|
* Update License in File HeadersFordy2012-05-181-1/+1
| | | | | | 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.
* Clean up warningsPieter Wuille2012-05-091-3/+2
| | | | | | * Use -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameters * Remove xCXXFLAGS usage in makefile.unix * Fix several recent and older sign-compare warnings
* Fix addrman crashesPieter Wuille2012-05-051-2/+5
| | | | | | | | | A function returned the element to remove from a bucket, instead of its position in that bucket. This function was only called when a tried bucket overflowed, which only happens after many outgoing connections have been made. Closes: #1065, #1156
* Add extra asserts to addrmanPieter Wuille2012-05-051-0/+19
|
* Further reduce header dependenciesPieter Wuille2012-04-171-4/+4
| | | | | | | This commit removes the dependency of serialize.h on PROTOCOL_VERSION, and makes this parameter required instead of implicit. This is much saner, as it makes the places where changing a version number can have an influence obvious.
* Fix loop index var types, fixing many minor sign comparison warningsJeff Garzik2012-04-151-2/+2
| | | | | foo.size() typically returns an unsigned integral type; make loop variables match those types' signedness.
* fix warnings: '&&' within '||' [-Wlogical-op-parentheses]Wladimir J. van der Laan2012-04-151-1/+1
|
* CAddrMan: stochastic address managerPieter Wuille2012-02-241-0/+506
Design goals: * Only keep a limited number of addresses around, so that addr.dat does not grow without bound. * Keep the address tables in-memory, and occasionally write the table to addr.dat. * Make sure no (localized) attacker can fill the entire table with his nodes/addresses. See comments in addrman.h for more detailed information.