| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
This introduces a fixed limit for the size of p2p messages, and enforces it
before download.
Rebased-From: ba04c4a7801e7d68a5e84035b919e5c3626eb7a7
Github-Pull: #5843
|
| |
|
|
|
|
| |
- the call to CloseSocket() is placed after the WSAGetLastError(), because
a CloseSocket() can trigger an error also, which we don't want for the
logging in this two cases
|
| |
|
|
|
|
|
|
|
|
|
| |
Simpler alternative to #4348.
The current setup with closesocket() is strange. It poses
as a compatibility wrapper but adds functionality.
Rename it and make it a documented utility function in netbase.
Code movement only, zero effect on the functionality.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a -whitelist option to specify subnet ranges from which peers
that connect are whitelisted. In addition, there is a -whitebind option
which works like -bind, except peers connecting to it are also
whitelisted (allowing a separate listen port for trusted connections).
Being whitelisted has two effects (for now):
* They are immune to DoS disconnection/banning.
* Transactions they broadcast (which are valid) are always relayed,
even if they were already in the mempool. This means that a node
can function as a gateway for a local network, and that rebroadcasts
from the local network will work as expected.
Whitelisting replaces the magic exemption localhost had for DoS
disconnection (local addresses are still never banned, though), which
implied hidden service connects (from a localhost Tor node) were
incorrectly immune to DoS disconnection as well. This old
behaviour is removed for that reason, but can be restored using
-whitelist=127.0.0.1 or -whitelist=::1 can be specified. -whitebind
is safer to use in case non-trusted localhost connections are expected
(like hidden services).
|
| | |
|
| | |
|
| |
|
|
|
|
| |
- SO_NOSIGPIPE isn't available on WIN32 so merge the 2 non-WIN32 blocks
- use predefined names from header for IPV6_PROTECTION_LEVEL and
PROTECTION_LEVEL_UNRESTRICTED
|
| | |
|
| | |
|
| |
|
|
|
|
| |
... instead of after 30 minutes of no sending, for latency measurement
and keep-alive. Also, disconnect if no reply arrives within 20 minutes,
instead of 90 of inactivity (for peers supporting the 'pong' message).
|
| |
|
|
|
| |
- better code readability and it belongs to net
- this is a prerequisite for a pull to add -listen to the GUI
|
| | |
|
| |
|
|
|
|
| |
reduces time to service requests improving performance
Rebased-From: 9189f5fe4df1ac7ea6ca75ceada867beafda90a9
|
| |
|
|
| |
The goal is to increase independence and privacy.
|
| |
|
|
|
|
|
|
|
| |
Fixes #4679.
This leaves us with only one candidate, checkip.dyndns.org.
GetMyExternalIP should be phased out as soon as possible.
Rebased-From: c33b983
|
| |
|
|
|
|
|
|
|
|
| |
NodeSyncScore() should find the node which we recv data most recently, so put a negative sign to pnode->nLastRecv is indeed wrong.
Also change the return value type to int64_t.
Signed-off-by: Huang Le <[email protected]>
Rebased-By: Wladimir J. van der Laan <[email protected]>
Rebased-From: 09a54a6
|
| |
|
|
|
|
|
|
|
|
| |
Log the name of the error as well as the error code if a network problem
happens. This makes network troubleshooting more convenient.
Use thread-safe strerror_r and the WIN32 equivalent FormatMessage.
Conflicts:
src/netbase.cpp
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Adds two new info query commands that take over information from
hodge-podge `getinfo`.
Also some new information is added:
- `getblockchaininfo`
- `chain`: (string) current chain (main, testnet3, regtest)
- `verificationprogress: (numeric) estimated verification progress
- `chainwork`
- `getnetworkinfo`
- `localaddresses`: (array) local addresses, from mapLocalHost (fixes #1734)
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
The year is 2014. All supported operating systems have IPv6 support,
most certainly at build time (this doesn't mean that IPv6 is configured,
of course).
If noone is exercising the functionality to disable it, that means it
doesn't get tested, and IMO it's better to get rid of it.
(it's also not used consistently in RPC/boost and Net code...)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we are over our outbound limit ThreadSocketHandler would try to
keep the connection if the peer was addnoded.
This didn't actually work for two reasons: It didn't actually run
the accept code due to mistaken code flow, and because we have a
limited number of outbound semaphores it couldn't actually use the
connection.
Instead it leaked the socket, which might have caused issue #4034.
This patch just takes out the non-functioning white-listing for now.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
When bitcoind can't bind, bitcoin server (or Bitcoin Core Daemon) is
probably already running. Add the missing word "server". Bitcoin itself
is definitely running ;-)
Add _(...) so the string can be localized.
Rebased-From: 094eeff, 2d2d8fa
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Amend to d5f1e72. It turns out that BerkelyDB was including inttypes.h
indirectly, so we cannot fix this with just macros.
Trivial commit: apply the following script to all .cpp and .h files:
# Middle
sed -i 's/"PRIx64"/x/g' "$1"
sed -i 's/"PRIu64"/u/g' "$1"
sed -i 's/"PRId64"/d/g' "$1"
# Initial
sed -i 's/PRIx64"/"x/g' "$1"
sed -i 's/PRIu64"/"u/g' "$1"
sed -i 's/PRId64"/"d/g' "$1"
# Trailing
sed -i 's/"PRIx64/x"/g' "$1"
sed -i 's/"PRIu64/u"/g' "$1"
sed -i 's/"PRId64/d"/g' "$1"
After this commit, `git grep` for PRI.64 should turn up nothing except
the defines in util.h.
|
| |
|
|
|
|
| |
in 2014.
contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Moved includes of "db.h" into #ifdef ENABLE_WALLET blocks or remove
them.
|
| |\
| |
| |
| | |
80ecf67 Add ThreadGetMyExternalIP to net thread group (Gavin Andresen)
|
| | |
| |
| |
| | |
Fixes #3372 -- crash at shutdown.
|
| |/ |
|
| |
|
|
|
|
|
|
|
| |
This was a leftover from the times in which
peers.dat depended in BDB.
Other functions in db.cpp still depend on BerkelyDB,
to be able to compile without BDB this (small)
functionality needs to be moved to another file.
|
| | |
|
| |\
| |
| |
| | |
379778b core: remove includes in .cpp, if header is already in .h (Philip Kaufmann)
|
| | |
| |
| |
| |
| | |
- example: if util.h includes stdint.h, remove it from util.cpp, as
util.h is the first header included in util.cpp
|
| |/ |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
| |
I needed this to test the new "reject" p2p message, but it should be generally
useful for fuzz-testing network message handling code.
|
| |
|
|
|
|
|
| |
The existing CNode::addrLocal member is revealed to the user,
as an address string, similar to the existing "addr" field.
Instead of showing garbage or empty string,
it simply will not appear in the output if local address not known yet.
|
| |\
| |
| | |
Allow SendMessages to run partially without cs_main
|
| | | |
|
| |\ \
| |/
|/|
| | |
db0e8cc Bump Year Number to 2013 (super3)
|
| | | |
|
| |\ \
| | |
| | | |
[QT] Add network traffic graph to debug window
|
| | | | |
|
| |\ \ \
| |/ /
|/| | |
Refactor/encapsulate chain globals into a CChain class
|
| | |/ |
|