Commit Graph

10784 Commits

Author SHA1 Message Date
MarcoFalke
74ec1d8c8a [qa] Add amount tests 2018-10-19 19:42:40 +03:00
MarcoFalke
fb9c7896c4 [amount] Add support for negative fee rates 2018-10-19 19:40:44 +03:00
lateminer
b51c500e6e Replace remaining Lore mentions with Blackmore 2018-10-19 01:09:44 +03:00
lateminer
970a285dc2 Doxyfile: v2.12.2 2018-10-19 00:55:13 +03:00
lateminer
1874993043 Fix multiple backporting errors 2018-10-19 00:54:22 +03:00
Pavel Janík
8b2e1d8a04 Do not shadow member variables 2018-10-19 00:03:18 +03:00
Cory Fields
9d9499fd40 net: fixup nits 2018-10-19 00:03:01 +03:00
Cory Fields
819f4b8dfe net: Split resolving out of CSubNet 2018-10-19 00:01:51 +03:00
Cory Fields
116718f5d5 net: move CNetAddr/CService/CSubNet out of netbase 2018-10-18 23:56:44 +03:00
21E14
7efc89cd18 CCoinsViewErrorCatcher raison-d-etre 2018-10-18 23:40:49 +03:00
Patrick Strateman
c312b47cce Acquire lock to check for genesis block. 2018-10-18 23:40:08 +03:00
instagibbs
1b6cba2d1f Add cmpctblock to debug help list
Github-Pull: #8637
Rebased-From: b2e93a343ec2dc7d255b970e6ee45e9c390f7ed0
2018-10-18 23:38:58 +03:00
Gregory Maxwell
8bbe525e02 Use RelevantServices instead of node_network in AttemptToEvict.
Use of node_network here is really meant to be a proxy of "likely to
 send us blocks in the future".  RelevantServices is the right criteria
 now.

Github-Pull: #9052
Rebased-From: d32036a47d9ccdc38628a7a75bb8b711af462e4f
2018-10-18 23:33:16 +03:00
MarcoFalke
5ef877ba8f [net] Remove assert(nMaxInbound > 0)
nMaxInbound might very well be 0 or -1, if the user prefers to keep
a small number of maxconnections.

Note: nMaxInbound of -1 means that the user set maxconnections
to 8 or less, but we still want to keep an additional slot for
the feeler connection.

Github-Pull: #9008
Rebased-From: fa1c3c2eb0a1853ed0e0662fc2bdbca51e05ccf5
2018-10-18 23:32:56 +03:00
Wladimir J. van der Laan
a14ed45674 nMaxOutbound is MAX_OUTBOUND_CONNECTIONS on 0.13
Github-Pull: #8949
2018-10-18 23:32:46 +03:00
Gregory Maxwell
7b0cd213fc Make dnsseed's definition of acute need include relevant services.
We normally prefer to connect to peers offering the relevant services.

If we're not connected to enough peers with relevant services, we
 probably don't know about them and could use dnsseed's help.

Github-Pull: #8949
Rebased-From: 46304791353d2bb61004a035869612620c30b4eb
2018-10-18 23:32:37 +03:00
Gregory Maxwell
784ceae891 Be more aggressive in connecting to peers with relevant services.
Only allow skipping relevant services until there are four outbound
 connections up.

This avoids quickly filling up with peers lacking the relevant
 services when addrman has few or none of them.

Github-Pull: #8949
Rebased-From: 9583477288072e203541b747fcffe8d50cfefb8d
2018-10-18 23:32:28 +03:00
Matt Corallo
a72b866b00 Remove bogus assert on number of oubound connections.
This value can be significantly higher if the users uses addnode

Github-Pull: #8944
Rebased-From: 1ab21cf344ed0547de5ae679b7e479cb4b1a923b
2018-10-18 23:32:18 +03:00
Matt Corallo
4faf4c99f7 Comment that most dnsseeds only support some service bits combos 2018-10-18 23:32:08 +03:00
leijurv
e0e706c9cf various typos 2018-10-18 23:30:54 +03:00
Ethan Heilman
82072c13f8 Added feeler connections increasing good addrs in the tried table. 2018-10-18 23:26:46 +03:00
Wladimir J. van der Laan
c808450d87 http: Force-exit event loop after predefined time
This makes sure that the event loop eventually terminates, even if an
event (like an open timeout, or a hanging connection) happens to be
holding it up.
2018-10-18 23:12:41 +03:00
Wladimir J. van der Laan
d57bd81ce6 http: Restrict maximum size of request line + headers
Prevent memory exhaustion by sending lots of data.
Also add a test to `httpbasics.py`.

Closes #6425
2018-10-18 23:12:06 +03:00
Cory Fields
84a208b9d2 net: Have LookupNumeric return a CService directly 2018-10-18 23:10:38 +03:00
Cory Fields
327528fbf1 httpserver: replace boost threads with std
along with mutex/condvar/bind/etc.

httpserver handles its own interruption, so there's no reason not to use std
threading.

While we're at it, may as well kill the BOOST_FOREACH's as well.
2018-10-18 23:08:28 +03:00
Cory Fields
75050e103d httpserver: explicitly detach worker threads
When using std::thread in place of boost::thread, letting the threads destruct
results in a std::terminate. According to the docs, the same thing should be
be happening in later boost versions:
http://www.boost.org/doc/libs/1_55_0/doc/html/thread/thread_management.html#thread.thread_management.thread.destructor

I'm unsure why this hasn't blown up already, but explicitly detaching can't
hurt.
2018-10-18 23:08:19 +03:00
Cory Fields
09d5672a7d httpserver: use a future rather than relying on boost's try_join_for 2018-10-18 23:08:10 +03:00
Wladimir J. van der Laan
3f1e8b16e4 http: use std::move to move HTTPRequest into HTTPWorkItem
Thanks to Cory Fields for the idea.
2018-10-18 23:08:00 +03:00
Wladimir J. van der Laan
8e657ffec9 http: Change boost::scoped_ptr to std::unique_ptr in HTTPRequest
No need for boost here.
2018-10-18 23:07:52 +03:00
Wladimir J. van der Laan
9c27beef9d http: Add log message when work queue is full
More useful error reporting.
2018-10-18 23:07:43 +03:00
Wladimir J. van der Laan
2e29b6003c http: Do a pending c++11 simplification
Use std::unique_ptr for handling work items.

This makes the code more RAII and, as mentioned in the comment, is what
I planned when I wrote the code in the first place.
2018-10-18 23:07:34 +03:00
Pieter Wuille
4b61ea916b Update banning functions from Core 0.13 2018-10-18 23:03:54 +03:00
Cory Fields
620e64b25f net: narrow include scope after moving to netaddress 2018-10-18 22:56:46 +03:00
Cory Fields
4de79a2a14 net: Split resolving out of CService 2018-10-18 22:55:26 +03:00
Cory Fields
e5dba2d293 net: Split resolving out of CNetAddr 2018-10-18 22:55:14 +03:00
Pieter Wuille
fbc3049bd3 Add extra message to avoid a long 'Loading banlist' 2018-10-18 22:52:55 +03:00
Warren Togami
8bfb3ffc96 Use Socks5ErrorString() to decode error responses from socks proxy. 2018-10-18 22:48:06 +03:00
Warren Togami
3368cd6cd0 Make Socks5() InterruptibleRecv() timeout/failures informative.
Before:
2016-05-16 06:10:45 ERROR: Error reading proxy response

After:
2016-05-16 06:10:45 Socks5() connect to k7s5d6jqig4ej4v4.onion:18333 failed: InterruptibleRecv() timeout or other failure
2018-10-18 22:47:56 +03:00
Warren Togami
f8318d8e02 SOCKS5 connecting and connected messages with -debug=net.
They were too noisy and not necessary for normal operation.
2018-10-18 22:47:36 +03:00
Warren Togami
79cecb3125 Make failures to connect via Socks5() more informative and less unnecessarily scary.
* The "ERROR" was printed far too often during normal operation for what was not an error.
* Makes the Socks5() connect failure similar to the IP connect failure in debug.log.

Before:
`2016-05-09 00:15:00 ERROR: Proxy error: host unreachable`

After:
`2016-05-09 00:15:00 Socks5() connect to t6xj6wilh4ytvcs7.onion:18333 failed: host unreachable"`
2018-10-18 22:47:28 +03:00
Pieter Wuille
2e694c450d Randomize name lookup result in ConnectSocketByName 2018-10-18 22:47:16 +03:00
Cory Fields
aaedfba6ee net: disable resolving from storage structures
CNetAddr/CService/CSubnet can no longer resolve DNS.
2018-10-18 22:47:04 +03:00
Cory Fields
d50d2bbded net: resolve outside of storage structures
Rather than allowing CNetAddr/CService/CSubNet to launch DNS queries, require
that addresses are already resolved.

This greatly simplifies async resolve logic, and makes it harder to
accidentally leak DNS queries.
2018-10-18 22:46:54 +03:00
Luke Dashjr
ef6e708ded Combine common error strings for different options so translations can be shared and reused 2018-10-18 22:46:39 +03:00
Gregory Maxwell
4b310cec5d Allow disconnecting a netgroup with only one member in eviction.
With the latest additions there are enough protective measures that
 we can take the training wheels off.
2018-10-18 22:36:01 +03:00
Gregory Maxwell
35c0e679b7 Add recently accepted blocks and txn to AttemptToEvictConnection.
This protects any not-already-protected peers who were the most
 recent four to relay transactions and most recent four to send
 blocks to us.
2018-10-18 22:35:51 +03:00
Pieter Wuille
8f3520e4c5 Do not set extra flags for unfiltered DNS seed results 2018-10-18 22:35:42 +03:00
Pieter Wuille
098b500849 Prevent duplicate connections where one is by name and another by ip 2018-10-18 22:34:08 +03:00
Pieter Wuille
0fc3b89fa1 Rework addnode behaviour 2018-10-18 22:33:58 +03:00
Pieter Wuille
cb47af78cc Introduce REQUIRED_SERVICES constant 2018-10-18 22:32:31 +03:00