Improved getblocks logging. #2126

Closed
wants to merge 2 commits into
from

Projects

None yet

5 participants

@rebroad

Adds some useful debug info to help keep track of getblock requests. Only shows request if actually carried out (previously showed request even if it wasn't done).

@rebroad rebroad commented on the diff Dec 23, 2012
src/main.cpp
@@ -2206,7 +2206,8 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp)
mapOrphanBlocksByPrev.insert(make_pair(pblock2->hashPrevBlock, pblock2));
// Ask this guy to fill in what we're missing
- pfrom->PushGetBlocks(pindexBest, GetOrphanRoot(pblock2));
+ if (pfrom->PushGetBlocks(pindexBest, GetOrphanRoot(pblock2)))
+ printf("fill-in getblocks to %s\n", pfrom->addr.ToString().c_str());
@rebroad
rebroad Dec 23, 2012

I've just noticed by code includes detail of the node it's requesting to. Is this ok, or shall I make it dependant on a command-line option?

@BitcoinPullTester

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/da30975fe13ab227e1b48d68675e7cf8aa84d8e3 for binaries and test log.

@BitcoinPullTester

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/2da3e92e55f821514fe4f914eda8e78bcb960e2f for binaries and test log.

@darkhosis

I like it. I already modified the source myself to include the IPs that were requesting blocks (so I could tcpkill the lunatic clients).... I remember asking about that in the dev channel and they prefer not to have the IPs show up.

I run a bitcoind (or two) on my home connection from time to time & with my CPU and 32GB RAM, if I have 200 connections, I can see about 100 of those block requests... but with a max of 1536kbps upstream, they aren't going anywhere.

@BitcoinPullTester

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/2da3e92e55f821514fe4f914eda8e78bcb960e2f for binaries and test log.

@luke-jr
Bitcoin member

As darkhosis mentioned, logging IPs by default is a bad idea since it makes Bitcoin users targets for crackers who want to abuse the information.

@rebroad

I'll edit to remove the IP address logging... Will close until this is done.

@rebroad rebroad closed this Jan 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment