Commit graph

6338 commits

Author SHA1 Message Date
Patrick Lodder f626f8f436 Merge branch '1.8.3-dev' into 1.8-maint
merges the actually released 1.8.3 into 1.8-maint
2016-02-21 16:49:03 +01:00
Max K. eab30077ff Merge pull request #1309 from Sporklin/1.8.3-dev-Fixmanpagesports
Updating ports to proper Dogecoin ports. Missed somehow.
2015-10-20 20:19:01 +02:00
Sporklin 72bba7b6ec Updating ports to proper Dogecoin ports. Missed somehow. 2015-10-20 13:38:31 -04:00
Max K. a28062df9b Merge pull request #1305 from patricklodder/1.8.3-upnp-descr
fix miniupnp dir in gitian descriptors
2015-10-18 19:40:39 +02:00
Patrick Lodder a4f2c6cb02 fix miniupnp dir in gitian descriptors 2015-10-18 19:37:58 +02:00
Max K. e6e34e13d9 Merge pull request #1209 from rnicoll/1.8.3-bip66
Apply BIP 66 changes to 1.8.3 client
2015-10-18 18:41:18 +02:00
Patrick Lodder bc4aebb8a7 Only test supermajority for block rejects against v3 blocks
Since v2 and v1 blocks will be rejected at exactly the same time,
only check for supermajority once to save 2000 iterations over
blockheaders per block.

Also moves the version check to AcceptBlockHeader() rather than
AcceptBlock() to be able to reject early on.
2015-10-18 13:28:59 +00:00
Patrick Lodder 288fc013ba Use the same time-based constraints as in 1.10
Backport of #1225 to 1.8.x, sets:
- majority window to 2000 blocks on mainnet, 1000 on testnet
- enforcement triggers to 1500 on mainnet, 501 on testnet
- reject triggers to 1900 on mainnet, 750 on testnet
2015-10-18 13:28:59 +00:00
Patrick Lodder 320234c0e5 Reject version 1 blocks with version 3 supermajority
Because CBlockIndex::IsSuperMajority was disabled since 1.5, we cannot
enforce version 1 block rejection on the live chains with a v2 supermajority.
Instead, we piggyback the version 3 supermajority switch to also enforce the
version 2 softfork and all is good.
2015-10-18 13:28:59 +00:00
Patrick Lodder e1a900b1bc enable CBlockIndex::IsSuperMajority
This has been disabled since 1.5 for unclear reasons, but we need it
for the bip66 softfork in 1.10 that is backported here. This commit
re-enables the logic.
2015-10-18 13:28:59 +00:00
Patrick Lodder 096d657914 Implement [CBlock|CBlockIndex]::GetBaseVersion()
- nVersion & 0xff to easily compare versions without aux data
- change implementations checking nVersion throughout main.ccp
2015-10-18 13:28:59 +00:00
Ross Nicoll c71c351176 Correct BIP 66 patches 2015-10-18 13:28:59 +00:00
Pieter Wuille 53a49c0246 Implement BIP 66 validation rules and switchover logic 2015-10-18 13:28:59 +00:00
Pieter Wuille cdb81cec3f Backport of some of BIP66's tests 2015-10-18 13:28:59 +00:00
Pieter Wuille 1d554b1d45 Raise version of created blocks, and enforce DERSIG in mempool 2015-10-18 13:28:59 +00:00
Ross Nicoll e9da230e26 Merge pull request #1280 from patricklodder/1.8.3-backport-protocol-change
Backport protocol 70004 to 1.8.3
2015-10-18 14:22:43 +01:00
Ross Nicoll a93cebe01d Merge pull request #1302 from patricklodder/1.8.3-low-s
Backport standard low-s verification to 1.8.3
2015-10-18 14:22:35 +01:00
Patrick Lodder 876e01e16c Make low-s verification mandatory for standard script verification
1.8.3 backport

This change makes a node only accept transactions with low-s
signature encoding for relay and mining, but allows transactions
with high-s signature encoding in mined blocks (no blocks will
be rejected)
2015-10-17 13:30:23 +02:00
Patrick Lodder 6f41e4473d Merge pull request #1296 from Sporklin/1.8.3-dev-miniupnp
Updated miniupnpc version for gitian.
2015-10-12 23:42:22 +02:00
Sporklin 4e483ae47d Updated miniupnpc version. 2015-10-12 17:29:45 -04:00
Ross Nicoll a66ba29af6 Merge pull request #1293 from acerix/1.8.3-dev
apply bitcoin patch for miniupnpc 1.9
2015-10-12 20:17:51 +01:00
acerix 984e204d7c apply bitcoin patch for miniupnpc 1.9 2015-10-12 11:35:15 -04:00
Patrick Lodder 178f25bce4 Backport protocol 70004 to 1.8.3 2015-09-09 13:36:35 +02:00
langerhans 66eb58e86c Merge branch '1.8.3-dev' into 1.8-maint 2015-07-02 19:54:14 +02:00
Ross Nicoll bbdf5e93d7 Merge pull request #1191 from langerhans/1.8.3-releaseprep
Release prep for 1.8.3
2015-06-30 19:18:05 +01:00
langerhans d911656e1a Add release notes for 1.8.3 2015-06-29 20:38:41 +02:00
langerhans 81e3357b0e Update the version numbers to 1.8.3 2015-06-29 20:26:15 +02:00
langerhans fdd74c2069 Add a fresh set of fixed and DNS seeds. 2015-06-29 20:22:49 +02:00
Max K. 7f2e24a00b Merge pull request #1190 from rnicoll/1.8-1d21ba2f5ecbf03086d0b65c4c4c80a39a94c2ee
Backport Bitcoin Core 0.10.x P2P changes to Dogecoin 1.8.3
2015-06-29 19:53:22 +02:00
Pieter Wuille cc0ac7a749 Scale up addrman
This change was suggested as Countermeasure 6 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: 1d21ba2f5e
Github-Pull: #5941

Conflicts:
	src/addrman.h
2015-06-27 14:15:32 +00:00
Pieter Wuille 9b95692530 Always use a 50% chance to choose between tried and new entries
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: c6a63ceeb4
Github-Pull: #5941
2015-06-27 14:15:32 +00:00
Pieter Wuille 7902f4cc01 Do not bias outgoing connections towards fresh addresses
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
2015-06-27 14:15:32 +00:00
Pieter Wuille a56e94f913 Simplify hashing code
Conflicts:
	src/addrman.cpp

Rebased-From: a8ff7c62ed
Github-Pull: #5941
2015-06-27 14:15:32 +00:00
Pieter Wuille 6ae9da28d4 Make addrman's bucket placement deterministic.
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: e6b343d880
Github-Pull: #5941

Conflicts:
	src/addrman.cpp
	src/addrman.h
2015-06-27 14:15:32 +00:00
Pieter Wuille bd36a593d6 Switch addrman key from vector to uint256
Conflicts:
	src/addrman.cpp

Rebased-From: b23add5521
Github-Pull: #5941
2015-06-27 14:15:32 +00:00
Pieter Wuille b8ad085955 Reduce fingerprinting through timestamps in 'addr' messages.
Suggested by Jonas Nick.

Rebased-From: 9c2737901b
Github-Pull: #5860
2015-06-27 14:15:32 +00:00
Pieter Wuille fe3a31384c Limit message sizes before transfer
This introduces a fixed limit for the size of p2p messages, and enforces it
before download.

Rebased-From: ba04c4a780
Github-Pull: #5843
2015-06-27 14:15:26 +00:00
Philip Kaufmann c118e9d275 prevent SOCKET leak in BindListenPort()
- 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
2015-06-27 14:11:36 +00:00
Wladimir J. van der Laan a15d1b4fc1 Convert closesocket 'compat wrapper' to function in netbase
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.
2015-06-27 14:11:36 +00:00
Pieter Wuille 19d00a2dff Break up CAddrMan's IMPLEMENT_SERIALIZE 2015-06-27 14:11:36 +00:00
Pieter Wuille 6f86ee9cae Introduce whitelisted peers.
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).
2015-06-27 14:11:36 +00:00
Philip Kaufmann 33333d2e88 error out, when we detect -socks argument 2015-06-27 13:45:18 +00:00
Philip Kaufmann c5c5ddce02 remove SOCKS4 support from core and GUI
- now we support SOCKS5 only
2015-06-27 13:45:18 +00:00
Pieter Wuille d0952adabd Use pong receive time rather than processing time 2015-06-27 13:45:18 +00:00
Philip Kaufmann fbf7c3623d add missing BOOST_FOREACH indentation in ThreadSocketHandler() 2015-06-27 13:45:18 +00:00
Philip Kaufmann a8fe7c245b small cleanup of #ifdefs in BindListenPort()
- 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
2015-06-27 13:44:15 +00:00
Philip Kaufmann 845fc0eb13 add missing vhListenSocket.clear(); to CNetCleanup() 2015-06-27 13:44:15 +00:00
Philip Kaufmann 636716439a remove unused CNode::Cleanup() 2015-06-27 13:44:14 +00:00
Pieter Wuille d617424616 Ping automatically every 2 minutes (unconditionally)
... 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).
2015-06-27 13:44:14 +00:00
Philip Kaufmann f347f7ebb3 rename fNoListen to fListen and move to net
- better code readability and it belongs to net
- this is a prerequisite for a pull to add -listen to the GUI
2015-06-27 13:44:14 +00:00