Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I set the following when I run bitcoind -debug -server -detachdb -printtodebugger -printtoconsole


socket recv flood control disconnect (5018020 bytes)
disconnecting node


What client actions would cause this entry to appear?

What settings (client side or server side) are available to adjust this for higher or lower capacity?

What side effects are there with adjusting this capacity (semaphore lockups, db contention, etc)

share|improve this question
up vote 1 down vote accepted

In the Bitcoin protocol each message is prefixed with a message header that, among other things, contains the message length (more precisely the payload length). The length field is an unsigned integer 4 byte (or 32 bit) in length. Therefore it is perfectly ok to specify payloads of length 2^32 bytes = 4 GB.

Since you wouldn't want to download 4 GB just to find out that it was an error in the other sides implementation or the peer was trying to feed you junk on purpose the mainline client added an arbitrary limit to the size of messages it accepts.

According to net.h this limit is 5'000'000 byte or a bit less than 5 megabyte. The message that caused the error and subsequent disconnect is just a little bit over that limit. Maybe you could look up which peer, or even better which client version, caused the error so we can inform the developers about it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.