Add -blocksonly option #6993
pull pstratem wants to merge 8 commits into bitcoin:master from pstratem:blocksonly changing 5 files +21 −4-
pstratem commented at 2:26 am on November 12, 2015: contributorSet fRelay=false and reject all transactions into the mempool
-
dcousens commented at 3:06 am on November 12, 2015: contributorConcept ACK
-
luke-jr commented at 4:12 am on November 12, 2015: memberShould this force wallet off? But I suppose maybe watch-only wallets don’t need to submit txns…
-
luke-jr commented at 4:33 am on November 12, 2015: memberAs the code is right now, I don’t think you can submit txns…
-
gmaxwell commented at 5:46 am on November 12, 2015: contributorPerhaps there is a reason it was record setting? :P
-
gmaxwell commented at 5:53 am on November 12, 2015: contributorIf, instead of blocking at the mempool it did not getdata, then local transactions would work, and you just need to disable the getdata inhibition for whitebinded peers, and the peer is local– so you’d keep your same lines of code count. Happy?
-
paveljanik commented at 6:23 am on November 12, 2015: contributorThe option should be documented, so yet another line is needed :-)
-
paveljanik commented at 6:27 am on November 12, 2015: contributorWhat will we do to remote peers relaying transactions to us ignoring we announced that we do not want transactions in
version
message? -
laanwj added the label P2P on Nov 12, 2015
-
laanwj commented at 6:45 am on November 12, 2015: member
Concept ACK.
Should this force wallet off? But I suppose maybe watch-only wallets don’t need to submit txns…
Otherwise there’s already
-walletbroadcast=0
. To run a wallet without broadcasting. -
jonasschnelli commented at 7:42 am on November 12, 2015: contributorConcept ACK. Agree with @paveljanik: needs a help message line and maybe a comment on src/net.cpp:L454.
-
MarcoFalke commented at 9:11 am on November 12, 2015: member
Otherwise there’s already -walletbroadcast=0
Use parameter interaction and set
-walletbroadcast=0
with-blocksonly
? -
laanwj commented at 10:28 am on November 12, 2015: member
@MarcoFalke Yes.
There was another similar issue raised on IRC: transactions from whitelisted peers. Even though nothing is accepted into the mempool, these are still relayed:
https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L4462
-
in src/main.cpp: in b04dcb0b04 outdated
4450@@ -4451,7 +4451,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, 4451 assert(recentRejects); 4452 recentRejects->insert(tx.GetHash()); 4453 4454- if (pfrom->fWhitelisted) { 4455+ if (pfrom->fWhitelisted && GetBoolArg("-whitelistalwaysrelay", true)) {
laanwj commented at 10:58 am on November 12, 2015:Please define astatic const bool DEFAULT_WHITELISTALWAYSRELAY = true;
inmain.h
and use that (sorry for making your patch even more hideously huge)
MarcoFalke commented at 11:01 am on November 12, 2015:Also, HelpMessage needs update?
MarcoFalke commented at 11:18 am on November 12, 2015:@pstratem You can hide them behindshowDebug
.pstratem commented at 11:15 am on November 12, 2015: contributor@MarcoFalke I’m not sure we cant to put either of these options in the HelpMessage
Unless you know what you’re doing these are really not a good idea to change.
jonasschnelli commented at 11:20 am on November 12, 2015: contributor@pstratem: for the sake of a central startup arguments “documentation” I think we need to add a help message for every startup parameter. If it’s a debugging/expert only feature, it should be placed behind the-debughelp
wall.petertodd commented at 10:28 pm on November 12, 2015: contributorWe really should define something like NODE_BLOCKS and NODE_TXS… Doesn’t necessarily need to be in this pull, but worth noting.pstratem commented at 0:30 am on November 13, 2015: contributor@petertodd agreedgmaxwell commented at 7:35 pm on November 13, 2015: contributorNeeds rebase. And my tested/code ack is held only on the fact that there is a global static setting for the default thats not used everywhere. :(laanwj commented at 8:03 am on November 14, 2015: memberThere was also talk about sending an empty filterload to peers in this mode, if they support NODE_BLOOM. Let’s do this (if still relevant) in a later pull, just mentioning it for completeness.
Edit: utACK
Add blocksonly mode 4044f07d1cDo not process tx inv's in blocksonly mode 420fa8143aAdd whitelistalwaysrelay option 3a964973feAdd help text for blocksonly and whitelistalwaysrelay 762b13b4d8Use DEFAULT_BLOCKSONLY and DEFAULT_WHITELISTALWAYSRELAY constants 71a2683f4bDisplay DEFAULT_WHITELISTALWAYSRELAY in help text 59441a0445Fix fRelayTxs comment 6a4982fb83Fix comment for blocksonly parameter interactions bbf49da408gmaxwell merged this on Nov 14, 2015gmaxwell closed this on Nov 14, 2015
gmaxwell referenced this in commit b632145ede on Nov 14, 2015rebroad commented at 7:13 pm on March 16, 2016: contributorErk.. This is really ugly… And the pull doesn’t even state who needs this functionality or why.gmaxwell commented at 10:37 pm on March 16, 2016: contributor@rebroad It’s fairly self explanatory. If you want to run a node that only processes blocks (e.g. don’t care about unconfirmed transactions); you can set this and save ~80% of your bandwidth, including all redundant transmission of block data; “Blocksonly”. This is good for many applications (including my laptop… :) )rebroad commented at 11:04 am on March 17, 2016: contributorAh, I thought I had raised a pull request for my Antisocial fork, but it seems not. I think it would be useful to have an option to do blocksonly during IBD only. Would this be of interest to anyone?zkbot referenced this in commit f1aeaec471 on Mar 21, 2018zkbot referenced this in commit 4fc490c430 on Dec 4, 2019zkbot referenced this in commit 868c63f92d on Dec 4, 2019zkbot referenced this in commit ba4eb241e7 on Mar 31, 2021DrahtBot locked this on Sep 8, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-07-16 15:13 UTC
More mirrored repositories can be found on mirror.b10c.me