aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/net.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * | net: add an internal subnet for representing unresolved hostnamesCory Fields2017-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently do two resolves for dns seeds: one for the results, and one to serve in addrman as the source for those addresses. There's no requirement that the source hostname resolves to the stored identifier, only that the mapping is unique. So rather than incurring the second lookup, combine a private subnet with a hash of the hostname. The resulting v6 ip is guaranteed not to be publicy routable, and has only a negligible chance of colliding with a user's internal network (which would be of no consequence anyway).
* | | Fixed multiple typosDimitris Tsapakidis2017-06-221-8/+8
| |/ |/| | | | | | | | | | | A few "a->an" and "an->a". "Shows, if the supplied default SOCKS5 proxy" -> "Shows if the supplied default SOCKS5 proxy". Change made on 3 occurrences. "without fully understanding the ramification of a command" -> "without fully understanding the ramifications of a command". Removed duplicate words such as "the the".
* | scripted-diff: Remove PAIRTYPEJorge Timón2017-06-051-1/+1
| | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/PAIRTYPE(\([^,]*\), \([^\)]*\))/std::pair<\1, \2>/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ; sed -i ':a;N;$!ba;s/#define std::pair<t1, t2> std::pair<t1, t2>\n//' ./src/utilstrencodings.h ; -END VERIFY SCRIPT-
* | scripted-diff: Fully remove BOOST_FOREACHJorge Timón2017-06-051-5/+5
|/ | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/BOOST_FOREACH *(\(.*\),/for (\1 :/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ; -END VERIFY SCRIPT-
* rpc: Add listen address to incoming connections in `getpeerinfo`Wladimir J. van der Laan2017-06-051-1/+4
| | | | | | | | | | | This adds the listening address on which incoming connections were received to the CNode and CNodeStats structures. The address is reported in `getpeerinfo`. This can be useful for distinguishing connections received on different listening ports (e.g. when using a different listening port for Tor hidden service connections) or different networks.
* Allow disconnectnode() to be called with node idJohn Newbery2017-04-191-7/+27
| | | | | | disconnectnode() can currently only be called with the IP address/port of the node the user wishes to connect. This commit allows the node to be disconnected using the nodeid returned by getpeerinfo().
* [rpc] rename disconnectnode argumentJohn Newbery2017-04-131-3/+3
|
* Merge #9853: Fix error codes from various RPCsWladimir J. van der Laan2017-03-091-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | adaa281 Update release notes to include RPC error code changes. (John Newbery) 338bf06 Add commenting around JSON error codes (John Newbery) dab804c Return correct error codes in fundrawtransaction(). (John Newbery) a012087 Return correct error codes in setban(). (John Newbery) 960bc7f Return correct error codes in removeprunedfunds(). (John Newbery) c119096 Return correct error codes in blockchain.cpp. (John Newbery) 6d07c62 Return correct error codes in bumpfee(). (John Newbery) Tree-SHA512: 4bb39ad221cd8c83d98ac5d7ad642f3a8c265522720dc86b2eebc70e74439a85b06d6ddcd6a874e879d986511de3ab0878bb7fe58b50cb0546b78913632ea809
| * Return correct error codes in setban().John Newbery2017-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The setban() RPC was returning misleading or incorrect error codes (for example RPC_CLIENT_NODE_ALREADY_ADDED when an invalid IP address was entered). This commit fixes those error codes: - RPC_CLIENT_INVALID_IP_OR_SUBNET should be returned if the client enters an invalid IP address or subnet. This commit also updates the test cases to explicitly test the error code. This commit also adds a testcase for trying to setban on an invalid subnet.
* | Refactor: Remove using namespace <xxx> from rpc/Karl-Johan Alm2017-03-081-21/+19
|/
* No longer allow "free" transactionsAlex Morcos2017-03-031-1/+1
| | | | | | Remove -limitfreerelay and always enforce minRelayTxFee in the mempool (except from disconnected blocks) Remove -relaypriority, the option was only used for the ability to allow free transactions to be relayed regardless of their priority. Both notions no longer apply.
* Merge #9615: Wallet incremental feeWladimir J. van der Laan2017-01-301-0/+3
|\ | | | | | | | | | | | | | | | | | | | | 4b189c1 Change bumpfee result value from 'oldfee' to 'origfee'. (Alex Morcos) 0c0c63f Introduce WALLET_INCREMENTAL_RELAY_FEE (Alex Morcos) e8021ec Use CWallet::GetMinimumFee in bumpfee (Alex Morcos) ae9719a Refactor GetMinimumFee to give option of providing targetFee (Alex Morcos) fe8e8ef [rpc] Add incremental relay fee to getnetworkinfo (Alex Morcos) 6b331e6 Fix to have miner test aware of new separate block min tx fee (Alex Morcos) de6400d Fix missing use of dustRelayFee (Alex Morcos) 5b15870 Use incrementalRelayFee for BIP 125 replacement (Alex Morcos)
| * [rpc] Add incremental relay fee to getnetworkinfoAlex Morcos2017-01-201-0/+3
| |
* | [trivial] Fix typos in commentspracticalswift2017-01-271-1/+1
|/
* RPC help updatedMichael Rotarius2017-01-111-5/+7
|
* Merge #8811: rpc: Add support for JSON-RPC named argumentsWladimir J. van der Laan2017-01-101-15/+17
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4e7e2e1 Update RPC argument names (John Newbery) 481f289 rpc: Named argument support for bitcoin-cli (Wladimir J. van der Laan) 9adb4e1 rpc: Argument name consistency (Wladimir J. van der Laan) 8d713f7 rpc: Named arguments for rawtransaction calls (Wladimir J. van der Laan) 37a166f rpc: Named arguments for wallet calls (Wladimir J. van der Laan) 78b684f rpc: Named arguments for mining calls (Wladimir J. van der Laan) b8ebc59 rpc: Named arguments for net calls (Wladimir J. van der Laan) 2ca9dcd test: Add test for RPC named arguments (Wladimir J. van der Laan) fba1a61 rpc: Named arguments for misc calls (Wladimir J. van der Laan) 286ec08 rpc: Add 'echo' call for testing (Wladimir J. van der Laan) 495eb44 rpc: Named arguments for blockchain calls (Wladimir J. van der Laan) 6f1c76a rpc: Support named arguments (Wladimir J. van der Laan) 5865d41 authproxy: Add support for RPC named arguments (Wladimir J. van der Laan)
| * Update RPC argument namesJohn Newbery2017-01-101-1/+1
| |
| * rpc: Named arguments for net callsWladimir J. van der Laan2017-01-051-15/+17
| | | | | | | | Also add a more descriptive message for `setnetworkactive`.
* | RPC help documentation for addnode peerinfo.Gregory Maxwell2017-01-051-0/+1
| | | | | | | | Also adds a comment about the netgroup exclusion behavior.
* | Break addnode out from the outbound connection limits.Gregory Maxwell2017-01-051-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously addnodes were in competition with outbound connections for access to the eight outbound slots. One result of this is that frequently a node with several addnode configured peers would end up connected to none of them, because while the addnode loop was in its two minute sleep the automatic connection logic would fill any free slots with random peers. This is particularly unwelcome to users trying to maintain links to specific nodes for fast block relay or purposes. Another result is that a group of nine or more nodes which are have addnode configured towards each other can become partitioned from the public network. This commit introduces a new limit of eight connections just for addnode peers which is not subject to any of the other connection limitations (including maxconnections). The choice of eight is sufficient so that under no condition would a user find themselves connected to fewer addnoded peers than previously. It is also low enough that users who are confused about the significance of more connections and have gotten too copy-and-paste happy will not consume more than twice the slot usage of a typical user. Any additional load on the network resulting from this will likely be offset by a reduction in users applying even more wasteful workaround for the prior behavior. The retry delays are reduced to avoid nodes sitting around without their added peers up, but are still sufficient to prevent overly aggressive repeated connections. The reduced delays also make the system much more responsive to the addnode RPC. Ban-disconnects are also exempted for peers added via addnode since the outbound addnode logic ignores bans. Previously it would ban an addnode then immediately reconnect to it. A minor change was also made to CSemaphoreGrant so that it is possible to re-acquire via an object whos grant was moved.
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Rename the remaining main.{h,cpp} to validation.{h,cpp}Matt Corallo2016-12-021-1/+1
|
* Move network-msg-processing code out of main to its own fileMatt Corallo2016-12-021-0/+1
|
* Merge #8996: Network activity toggleJonas Schnelli2016-11-111-1/+23
|\ | | | | | | | | | | | | | | | | 19f46f1 Qt: New network_disabled icon (Luke Dashjr) 54cf997 RPC/Net: Use boolean consistently for networkactive, and remove from getinfo (Luke Dashjr) b2b33d9 Overhaul network activity toggle (Jonas Schnelli) 32efa79 Qt: Add GUI feedback and control of network activity state. (Jon Lund Steffensen) e38993b RPC: Add "togglenetwork" method to toggle network activity temporarily (Jon Lund Steffensen) 7c9a98a Allow network activity to be temporarily suspended. (Jon Lund Steffensen)
| * RPC/Net: Use boolean consistently for networkactive, and remove from getinfoLuke Dashjr2016-10-241-4/+4
| |
| * Overhaul network activity toggleJonas Schnelli2016-10-241-7/+10
| | | | | | | | | | | | - Rename RPC command "togglenetwork" to "setnetworkactive (true|false)" - Add simple test case - GUI toggle added to connections icon in statusbar
| * RPC: Add "togglenetwork" method to toggle network activity temporarilyJon Lund Steffensen2016-10-241-0/+19
| | | | | | | | | | RPC command "togglenetwork" toggles network and returns new state after command. RPC command "getinfo" returns "networkactive" field in output.
* | fix getnettotals RPC description about timemillis.Masahiko Hyuga2016-11-101-1/+1
| |
* | [RPC] Give RPC commands more information about the RPC requestJonas Schnelli2016-10-191-36/+36
| |
* | Display minimum ping in debug window.R E Broadley2016-10-151-2/+2
|/
* Made the ForEachNode* functions in src/net.cpp more pragmatic and self ↵Jeremy Rubin2016-09-081-1/+0
| | | | documenting
* net: move nLocalServices/nRelevantServices to CConnmanCory Fields2016-09-081-1/+2
| | | | | These are in-turn passed to CNode at connection time. This allows us to offer different services to different peers (or test the effects of doing so).
* net: move send/recv statistics to CConnmanCory Fields2016-09-081-8/+10
|
* net: create generic functor accessors and move vNodes to CConnmanCory Fields2016-09-081-6/+7
|
* net: Add most functions needed for vNodes to CConnmanCory Fields2016-09-081-23/+13
|
* net: move added node functions to CConnmanCory Fields2016-09-081-11/+6
|
* net: move ban and addrman functions into CConnmanCory Fields2016-09-081-5/+12
|
* net: move OpenNetworkConnection into CConnmanCory Fields2016-09-081-1/+4
|
* Make the dummy argument to getaddednodeinfo optionalPieter Wuille2016-09-011-6/+5
|
* Merge #8163: Do not shadow global RPC table variable (tableRPC)Wladimir J. van der Laan2016-08-311-2/+2
|\ | | | | | | de1bbe3 Do not shadow global RPC table variable (tableRPC) (Pavel Janík)
| * Do not shadow global RPC table variable (tableRPC)Pavel Janík2016-08-251-2/+2
| |
* | Merge #8512: Trivial: Corrected JSON typo on setban of net.cppWladimir J. van der Laan2016-08-171-1/+1
|\ \ | |/ |/| | | 6ffd996 Corrected JSON typo on setban of net.cpp (Sev)
| * Corrected JSON typo on setban of net.cppSev2016-08-141-1/+1
| |
* | net: Split resolving out of CSubNetCory Fields2016-07-311-1/+1
| |
* | net: Split resolving out of CNetAddrCory Fields2016-07-311-2/+5
|/
* Rework addnode behaviourPieter Wuille2016-06-131-73/+22
| | | | | | | | | | * Use CNode::addeName to track whether a connection to a name is already open * A new connection to a previously-connected by-name addednode is only opened when the previous one closes (even if the name starts resolving to something else) * At most one connection is opened per addednode (even if the name resolves to multiple) * Unify the code between ThreadOpenAddedNodeConnections and getaddednodeinfo * Information about open connections is always returned, and the dns argument becomes a dummy * An IP address and inbound/outbound is only reported for the (at most 1) open connection
* Merge #8065: Addrman offline attemptsWladimir J. van der Laan2016-06-081-1/+1
|\ | | | | | | | | 6182d10 Do not increment nAttempts by more than one for every Good connection. (Gregory Maxwell) c769c4a Avoid counting failed connect attempts when probably offline. (Gregory Maxwell)
| * Avoid counting failed connect attempts when probably offline.Gregory Maxwell2016-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a node is offline failed outbound connection attempts will crank up the addrman counter and effectively blow away our state. This change reduces the problem by only counting attempts made while the node believes it has outbound connections to at least two netgroups. Connect and addnode connections are also not counted, as there is no reason to unequally penalize them for their more frequent connections -- though there should be no real effect from this unless their addnode configureation is later removed. Wasteful repeated connection attempts while only a few connections are up are avoided via nLastTry. This is still somewhat incomplete protection because our outbound peers could be down but not timed out or might all be on 'local' networks (although the requirement for multiple netgroups helps).
* | Merge #8049: Expose information on whether transaction relay is enabled in ↵Pieter Wuille2016-05-261-0/+2
|\ \ | |/ |/| | | | | | | | | `getnetwork` 1ab1dc3 rpc: Add `relaytxes` flag to `getnetworkinfo` (Wladimir J. van der Laan) 581ddff net: Add fRelayTxes flag (Wladimir J. van der Laan)
| * rpc: Add `relaytxes` flag to `getnetworkinfo`Wladimir J. van der Laan2016-05-121-0/+2
| | | | | | | | | | Re-work of PR #7841 by dragongem45. Closes #7771.