Skip to content

Commit

Permalink
Update -blocksonly documentation
Browse files Browse the repository at this point in the history
Summary:
> When -blocksonly is set to 1, it interacts with the -walletbroadcast
> parameter and sets it to 0 if it has not been set already.This behavior
> is not captured by the current documentation, which claims that -blocksonly
> does not impact any wallet transactions.
>
> Update the max number of outgoing peers from 8 to 10, due to the
> addition of two -blocksonly peers.

This is a backport of Core [[bitcoin/bitcoin#18391 | PR18391]] and [[bitcoin/bitcoin#18464 | PR18464]]

Test Plan: `ninja && src/bitcoind -help`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D8894
  • Loading branch information
glowang authored and PiRK committed Jan 14, 2021
1 parent dbf6207 commit d5a0492
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
5 changes: 3 additions & 2 deletions doc/reduce-memory.md
Expand Up @@ -24,8 +24,9 @@ The size of some in-memory caches can be reduced. As caches trade off memory usa

## Number of peers

- `-maxconnections=<n>` - the maximum number of connections, this defaults to `125`. Each active connection takes up some memory. Only significant if incoming
connections are enabled, otherwise the number of connections will never be more than `8`.
- `-maxconnections=<n>` - the maximum number of connections, this defaults to 4096. Each active connection takes up some
memory. This option applies only if incoming connections are enabled, otherwise the number of connections will never
be more than 10. Of the 10 outbound peers, there can be 8 full-relay connections and 2 block-relay-only ones.

## Thread configuration

Expand Down
16 changes: 11 additions & 5 deletions doc/reduce-traffic.md
Expand Up @@ -3,8 +3,10 @@ Reduce Traffic

Some node operators need to deal with bandwidth caps imposed by their ISPs.

By default, Bitcoin ABC allows up to 125 connections to different peers, 8 of
which are outbound. You can therefore, have at most 117 inbound connections.
By default, Bitcoin ABC allows up to 4096 connections to different peers, 10 of
which are outbound. You can therefore, have at most 4086 inbound connections.
Of the 10 outbound peers, there can be 8 full-relay connections and 2
block-relay-only ones.

The default settings can result in relatively significant traffic consumption.

Expand All @@ -26,7 +28,7 @@ calculating the target.

## 2. Disable "listening" (`-listen=0`)

Disabling listening will result in fewer nodes connected (remember the maximum of 8
Disabling listening will result in fewer nodes connected (remember the maximum of 10
outbound peers). Fewer nodes will result in less traffic usage as you are relaying
blocks and transactions to fewer nodes.

Expand All @@ -44,7 +46,11 @@ with other peers, you can disable transaction relay.
Be reminded of the effects of this setting.

- Fee estimation will no longer work.
- Not relaying other's transactions could hurt your privacy if used while a
wallet is loaded or if you use the node to broadcast transactions.
- It sets the flag "-walletbroadcast" to be "0", only if it is currently unset.
Doing so disables the automatic broadcasting of transactions from wallet. Not
relaying other's transactions could hurt your privacy if used while a wallet
is loaded or if you use the node to broadcast transactions.
- If a peer is whitelisted and "-whitelistforcerelay" is set to "1" (which will
also set "whitelistrelay" to "1"), we will still receive and relay their transactions.
- It makes block propagation slower because compact block relay can only be
used when transaction relay is enabled.
12 changes: 7 additions & 5 deletions src/init.cpp
Expand Up @@ -446,11 +446,13 @@ void SetupServerArgs(NodeContext &node) {
ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg(
"-blocksonly",
strprintf(
"Whether to reject transactions from network peers. Transactions "
"from the wallet, RPC and relay whitelisted inbound peers RPC are"
" not affected. (default: %u)",
DEFAULT_BLOCKSONLY),
strprintf("Whether to reject transactions from network peers. "
"Automatic broadcast and rebroadcast of any transactions "
"from inbound peers is disabled, unless "
"'-whitelistforcerelay' is '1', in which case whitelisted "
"peers' transactions will be relayed. RPC transactions are"
" not affected. (default: %u)",
DEFAULT_BLOCKSONLY),
ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg(
"-conf=<file>",
Expand Down

0 comments on commit d5a0492

Please sign in to comment.