user131606: The terms blocksonly and block-relay-only that are used in Bitcoin Core are very similar. What is the difference between them?

user131606: While both of these disable transaction relay, they are conceptually used for different purposes:
Block-relay-only connections (see this post for more details) are hard-to-detect connections with the goal of hardening the network against eclipse attacks. They have been introduced in v0.19.0.1 (2019) - since then, nodes will by default make two additional outgoing block-relay-only connections.
Blocksonly mode is an optional startup option (-blocksonly), introduced in v0.12.0 (2016) that has the goal of reducing the bandwidth of a node to a minimum by not participating in transaction relay.
There are various differences between these:

-blocksonly is a global startup option (applying to all connections) that is either active or not, block-relay-only is connection-specific.
A node in -blocksonly mode participates in address relay, while a node will never send out addresses over block-relay-only connections and ignores incoming addresses.
A node in -blocksonly signals not to receive any transactions and will disconnect peers that don't comply, but it will make an exception for whitelisted peers. There is no such exception for block-relay-only connections.
A node in -blocksonly mode may in special cases send out own transactions to its peers (for example if submitted directly via RPC). A node will never send a transaction over a block-relay-only connection.
A node in -blocksonly mode still treats two of their outbound connections as block-relay-only (for which then the stricter block-relay-only rules take precedence).


131606: <p>The terms blocksonly and block-relay-only that are used in Bitcoin Core are very similar. What is the difference between them?</p>
 131606: <p>While both of these disable transaction relay, they are conceptually used for different purposes:</p>
<p>Block-relay-only connections (see <a href="https://bitcoin.stackexchange.com/questions/112828/what-is-a-block-relay-only-connection-what-is-it-used-for">this post</a> for more details) are hard-to-detect connections with the goal of hardening the network against eclipse attacks. They have been introduced in v0.19.0.1 (2019) - since then, nodes will by default make two additional outgoing block-relay-only connections.</p>
<p>Blocksonly mode is an optional startup option (<code>-blocksonly</code>), introduced in v0.12.0 (2016) that has the goal of reducing the bandwidth of a node to a minimum by not participating in transaction relay.</p>
<p>There are various differences between these:</p>
<ul>
<li>-blocksonly is a global startup option (applying to all connections) that is either active or not, block-relay-only is connection-specific.</li>
<li>A node in -blocksonly mode participates in address relay, while a node will never send out addresses over block-relay-only connections and ignores incoming addresses.</li>
<li>A node in -blocksonly signals not to receive any transactions and will disconnect peers that don't comply, but it will make an exception for whitelisted peers. There is no such exception for block-relay-only connections.</li>
<li>A node in -blocksonly mode may in special cases send out own transactions to its peers (for example if submitted directly via RPC). A node will never send a transaction over a block-relay-only connection.</li>
<li>A node in -blocksonly mode still treats two of their outbound connections as block-relay-only (for which then the stricter block-relay-only rules take precedence).</li>
</ul>
