Commit Graph

7274 Commits

Author SHA1 Message Date
Pieter Wuille
c043d2fedc Introduce enum ServiceFlags for service flags 2018-10-18 22:32:23 +03:00
Pieter Wuille
645f26f52b Don't require services in -addnode 2018-10-18 22:29:19 +03:00
Ethan Heilman
4661755f32 Increase test coverage for addrman and addrinfo 2018-10-18 22:29:10 +03:00
Pieter Wuille
be365a0d15 Only store and connect to NODE_NETWORK nodes 2018-10-18 22:26:29 +03:00
Pieter Wuille
0c7d5a8af8 Verify that outbound connections have expected services 2018-10-18 22:26:18 +03:00
Pieter Wuille
f1d80ea69b Keep addrman's nService bits consistent with outbound observations 2018-10-18 22:26:08 +03:00
Wladimir J. van der Laan
1ee8436348 net: Add and document network messages in protocol.h 2018-10-18 22:21:11 +03:00
Wladimir J. van der Laan
0b00741a03 net: Account for sendheaders verack messages
Looks like these were forgotten in #6589.
2018-10-18 22:11:02 +03:00
Jonas Schnelli
68a0b905a7 log bytes recv/sent per command 2018-10-18 22:10:46 +03:00
instagibbs
6a4c64355e rename mapAddrCount to mapNetGroupNodes 2018-10-18 21:56:35 +03:00
Wladimir J. van der Laan
0c6f5bd006 test: Add more test vectors for siphash
Add full test vectors from spec, test per byte and per 8 bytes.

Builds on #8086.
2018-10-18 21:56:12 +03:00
Pieter Wuille
bcac49d880 Support SipHash with arbitrary byte writes 2018-10-18 21:55:46 +03:00
Pieter Wuille
3a1602b31d Use C++11 thread-safe static initializers 2018-10-18 21:55:20 +03:00
Pieter Wuille
a1d4facb14 Use 64-bit SipHash of netgroups in eviction 2018-10-18 21:55:11 +03:00
Patrick Strateman
02cfe3c9e8 Avoid recalculating vchKeyedNetGroup in eviction logic. 2018-10-18 21:53:52 +03:00
Pieter Wuille
f0d583e847 Use global ::fRelayTxes instead of CNode one 2018-10-18 21:49:32 +03:00
Gregory Maxwell
798fb2f972 Do not increment nAttempts by more than one for every Good connection.
This slows the increase of the nAttempts in addrman while partitioned,
 even if the node hasn't yet noticed the partitioning.
2018-10-18 21:49:17 +03:00
Gregory Maxwell
d3002718b5 Avoid counting failed connect attempts when probably offline. 2018-10-18 21:49:09 +03:00
Jonas Schnelli
0dd7c98e63 Add support for dnsseeds with option to filter by servicebits 2018-10-18 21:44:19 +03:00
Cory Fields
be75754cd7 net: No need to export DumpBanlist 2018-10-18 21:39:54 +03:00
Cory Fields
48f9c0e8b4 net: make Ban/Unban/ClearBan functionality consistent
- Ban/Unban/ClearBan call uiInterface.BannedListChanged() as necessary
- Ban/Unban/ClearBan sync to disk if the operation is user-invoked
- Mark node for disconnection automatically when banning
- Lock cs_vNodes while setting disconnected
- Don't spin in a tight loop while setting disconnected
2018-10-18 21:39:45 +03:00
Kaz Wesley
e8222a467f don't run ThreadMessageHandler at lowered priority
There's no clear reason ThreadMessageHandler should be low priority.
Fixes #8010 (priority inversion).
2018-10-18 21:39:36 +03:00
Cory Fields
5c11a7c29b net: Drop CNodeRef for AttemptToEvictConnection
Locking for each operation here is unnecessary, and solves the wrong problem.
Additionally, it introduces a problem when cs_vNodes is held in an owning
class, to which invididual CNodeRefs won't have access.

These should be weak pointers anyway, once vNodes contain shared pointers.

Rather than using a refcounting class, use a 3-step process instead.

1. Lock vNodes long enough to snapshot the fields necessary for comparing
2. Unlock and do the comparison
3. Re-lock and mark the resulting node for disconnection if it still exists
2018-10-18 21:39:27 +03:00
Cory Fields
9d1831b929 net: use the exposed GetNodeSignals() rather than g_signals directly 2018-10-18 21:39:17 +03:00
Cory Fields
e70188eb93 net: remove unused set 2018-10-18 21:39:08 +03:00
Cory Fields
91584b2ab0 net: don't import std namespace 2018-10-18 21:38:57 +03:00
Kaz Wesley
d8ebc0d4fc fix race that could fail to persist a ban 2018-10-18 21:36:45 +03:00
EthanHeilman
51c23024eb Fix de-serialization bug where AddrMan is corrupted after exception 2018-10-18 21:32:13 +03:00
Gregory Maxwell
350a2d9b50 More comments on the design of AttemptToEvictConnection.
Some developers clearly don't get this and have been posting
 "improvements" that create clear vulnerabilities.  It should
 have been better explained in the code, since the design
 is somewhat subtle and getting it right is important.
2018-10-18 21:23:43 +03:00
lateminer
b6a9d6dba7 Comment connectionsControl for now 2018-10-17 22:29:26 +03:00
Cory Fields
6c6ed197af net: manually resolve dns seed sources
Note: Some seeds aren't actually returning an IP for their name entries, so
they're being added to addrman with a source of [::].

This commit shouldn't change that behavior, for better or worse.
2018-10-17 22:17:45 +03:00
Cory Fields
52147e1b80 net: require lookup functions to specify all arguments
To make it clear where DNS resolves are happening
2018-10-17 22:17:28 +03:00
Gregory Maxwell
e577b5c7e1 Only send one GetAddr response per connection. 2018-10-17 22:14:44 +03:00
Chris Wheeler
ea8bac6c36 Typo fixes in comments 2018-10-17 22:12:07 +03:00
21E14
fcc23c5c63 Double semicolon cleanup. 2018-10-17 22:10:51 +03:00
Wladimir J. van der Laan
b72d6e77e8 qt: Prevent thread/memory leak on exiting RPCConsole 2018-10-17 22:06:34 +03:00
Wladimir J. van der Laan
e059dd192b [Qt] Clean up and fix coincontrol tree widget handling
- Do sorting for date, amount and confirmations column as longlong, not
  unsigned longlong.
- Use `UserRole` to store our own data. This makes it treated as
  ancillary data prevents it from being displayed.
- Get rid of `getMappedColumn` `strPad` - these are no longer necessary.
- Get rid of hidden `_INT64` columns.
- Start enumeration from 0 (otherwise values are undefined).
2018-10-17 21:56:26 +03:00
Jonas Schnelli
ce51b7401d [Qt] fix coincontrol sort issue 2018-10-17 21:56:15 +03:00
lateminer
786436baef Make it compile 2018-10-17 21:37:53 +03:00
Pieter Wuille
834db9539b Get rid of CTxMempool::lookup() entirely 2018-10-17 20:51:51 +03:00
Pieter Wuille
2737ac3d7f Optimization: use usec in expiration and reuse nNow 2018-10-17 20:51:42 +03:00
Pieter Wuille
594213c60d Optimization: don't check the mempool at all if no mempool req ever 2018-10-17 20:51:33 +03:00
Pieter Wuille
d4e4acd906 Optimize the relay map to use shared_ptr's 2018-10-17 20:51:23 +03:00
lateminer
ea21ee91da Fix typo
txmempool.h
2018-10-17 20:36:32 +03:00
Pieter Wuille
5e9497ce5b Add support for unique_ptr and shared_ptr to memusage 2018-10-17 20:34:57 +03:00
Pieter Wuille
ab86d7e4ff Switch CTransaction storage in mempool to std::shared_ptr 2018-10-17 20:34:25 +03:00
Suhas Daftuar
0814da4e9d Only use AddInventoryKnown for transactions
filterInventoryKnown is only used when relaying transactions,
so stop adding block hashes to the filter.
2018-10-17 20:32:50 +03:00
Gregory Maxwell
b3992a38d4 Defer inserting into maprelay until just before relaying. 2018-10-17 20:32:14 +03:00
Wladimir J. van der Laan
c41e3c69aa UpdateTip: log only one line at most per block 2018-10-17 20:26:54 +03:00
Gregory Maxwell
89655c3a1e Remove unneeded feerate param from RelayTransaction/AcceptToMemoryPool. 2018-10-17 20:22:44 +03:00