aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/net.cpp
AgeCommit message (Collapse)Author
2017-06-05scripted-diff: Fully remove BOOST_FOREACHJorge Timón
-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-
2017-06-05rpc: Add listen address to incoming connections in `getpeerinfo`Wladimir J. van der Laan
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.
2017-04-19Allow disconnectnode() to be called with node idJohn Newbery
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().
2017-04-13[rpc] rename disconnectnode argumentJohn Newbery
2017-03-09Merge #9853: Fix error codes from various RPCsWladimir J. van der Laan
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
2017-03-08Refactor: Remove using namespace <xxx> from rpc/Karl-Johan Alm
2017-03-07Return correct error codes in setban().John Newbery
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.
2017-03-03No longer allow "free" transactionsAlex Morcos
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.
2017-01-30Merge #9615: Wallet incremental feeWladimir J. van der Laan
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)
2017-01-27[trivial] Fix typos in commentspracticalswift
2017-01-20[rpc] Add incremental relay fee to getnetworkinfoAlex Morcos
2017-01-11RPC help updatedMichael Rotarius
2017-01-10Merge #8811: rpc: Add support for JSON-RPC named argumentsWladimir J. van der Laan
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)
2017-01-10Update RPC argument namesJohn Newbery
2017-01-05RPC help documentation for addnode peerinfo.Gregory Maxwell
Also adds a comment about the netgroup exclusion behavior.
2017-01-05Break addnode out from the outbound connection limits.Gregory Maxwell
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.
2017-01-05rpc: Named arguments for net callsWladimir J. van der Laan
Also add a more descriptive message for `setnetworkactive`.
2016-12-31Increment MIT Licence copyright header year on files modified in 2016isle2983
Edited via: $ contrib/devtools/copyright_header.py update .
2016-12-02Rename the remaining main.{h,cpp} to validation.{h,cpp}Matt Corallo
2016-12-02Move network-msg-processing code out of main to its own fileMatt Corallo
2016-11-11Merge #8996: Network activity toggleJonas Schnelli
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)
2016-11-10fix getnettotals RPC description about timemillis.Masahiko Hyuga
2016-10-24RPC/Net: Use boolean consistently for networkactive, and remove from getinfoLuke Dashjr
2016-10-24Overhaul network activity toggleJonas Schnelli
- Rename RPC command "togglenetwork" to "setnetworkactive (true|false)" - Add simple test case - GUI toggle added to connections icon in statusbar
2016-10-24RPC: Add "togglenetwork" method to toggle network activity temporarilyJon Lund Steffensen
RPC command "togglenetwork" toggles network and returns new state after command. RPC command "getinfo" returns "networkactive" field in output.
2016-10-19[RPC] Give RPC commands more information about the RPC requestJonas Schnelli
2016-10-15Display minimum ping in debug window.R E Broadley
2016-09-08Made the ForEachNode* functions in src/net.cpp more pragmatic and self ↵Jeremy Rubin
documenting
2016-09-08net: move nLocalServices/nRelevantServices to CConnmanCory Fields
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).
2016-09-08net: move send/recv statistics to CConnmanCory Fields
2016-09-08net: create generic functor accessors and move vNodes to CConnmanCory Fields
2016-09-08net: Add most functions needed for vNodes to CConnmanCory Fields
2016-09-08net: move added node functions to CConnmanCory Fields
2016-09-08net: move ban and addrman functions into CConnmanCory Fields
2016-09-08net: move OpenNetworkConnection into CConnmanCory Fields
2016-09-01Make the dummy argument to getaddednodeinfo optionalPieter Wuille
2016-08-31Merge #8163: Do not shadow global RPC table variable (tableRPC)Wladimir J. van der Laan
de1bbe3 Do not shadow global RPC table variable (tableRPC) (Pavel Janík)
2016-08-25Do not shadow global RPC table variable (tableRPC)Pavel Janík
2016-08-17Merge #8512: Trivial: Corrected JSON typo on setban of net.cppWladimir J. van der Laan
6ffd996 Corrected JSON typo on setban of net.cpp (Sev)
2016-08-14Corrected JSON typo on setban of net.cppSev
2016-07-31net: Split resolving out of CSubNetCory Fields
2016-07-31net: Split resolving out of CNetAddrCory Fields
2016-06-13Rework addnode behaviourPieter Wuille
* 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
2016-06-08Merge #8065: Addrman offline attemptsWladimir J. van der Laan
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)
2016-05-26Merge #8049: Expose information on whether transaction relay is enabled in ↵Pieter Wuille
`getnetwork` 1ab1dc3 rpc: Add `relaytxes` flag to `getnetworkinfo` (Wladimir J. van der Laan) 581ddff net: Add fRelayTxes flag (Wladimir J. van der Laan)
2016-05-26Avoid counting failed connect attempts when probably offline.Gregory Maxwell
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).
2016-05-12rpc: Add `relaytxes` flag to `getnetworkinfo`Wladimir J. van der Laan
Re-work of PR #7841 by dragongem45. Closes #7771.
2016-05-10net: make Ban/Unban/ClearBan functionality consistentCory Fields
- 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
2016-04-22push back getaddednodeinfo dead valueinstagibbs
2016-04-09RPC: do not print ping info in getpeerinfo when no ping received yet, fix helpPavel Janík