Restarted test node from wedged state @ +/- few seconds Wed Feb 26 21:42:58 CDT 2020 Few blocks behind this time from head ... Currently have 619153, head is at 619158 Have 8 connections. -------------------------------------------------------------------------- Code changes: Here are the code changes that I've compiled in this time -- this time, we go back to everything as it was, except now we're going to check the SendBufferSize _BEFORE_ we push a message. mod6@localhost ~/trb-keccak $ vdiff a b diff -uNr a/bitcoin/src/main.cpp b/bitcoin/src/main.cpp --- a/bitcoin/src/main.cpp 1f0735d2cee2f9ca2a177aead4ecc7a1371d59c4375aedb172ee99c28b02fa28e664decec9580a510bfca4738d85e377fb74396fe4979b75adbe1a3ec92b01c9 +++ b/bitcoin/src/main.cpp 31ed2548f3101eb843c379da067cdd869542f6d9681bbe2fe4a89cd4a663fd2fd61178939fea88ed7f0711ba4bdef078d1588864db592652c7aa19ae42eaab6f @@ -1877,6 +1877,7 @@ return error("message getdata size() = %d", vInv.size()); } + unsigned int nBytes = 0; BOOST_FOREACH(const CInv& inv, vInv) { if (fShutdown) @@ -1891,6 +1892,13 @@ { CBlock block; block.ReadFromDisk((*mi).second); + nBytes += block.GetSerializeSize(SER_NETWORK); + if (nBytes >= SendBufferSize()) + { + printf("getdata stopping at %u bytes\n", nBytes); + pfrom->Misbehaving(100); + break; + } pfrom->PushMessage("block", block); // Trigger them to send a getblocks request for the next batch of inventory @@ -1913,7 +1921,16 @@ { map::iterator mi = mapRelay.find(inv); if (mi != mapRelay.end()) + { + //nBytes += ((*mi).second).GetSerializeSize(SER_NETWORK); + //if (nBytes >= SendBufferSize()) + //{ + // printf("getdata stopping at %u bytes\n", nBytes); + // pfrom->Misbehaving(100); + // break; + //} pfrom->PushMessage(inv.GetCommand(), (*mi).second); + } } } else -------------------------------------------------------------------------- Test 5: Send 49999 'getdata for block' commands to the node, see how it reacts and if it recovers. Host, Port, File = 127.0.0.1, 8333, snap_49999.txt mod6@localhost ~ $ ./wedger.py 127.0.0.1 8333 snap_49999.txt Alive: V=99999 (/therealbitcoin.org:0.9.99.99/) Jumpers=0x1 (TRB-Compat.) Return Addr=1.2.3.4:8333 Blocks=619153 Sending 1799991-byte message packet... Now listening for replies (Ctl-C to quit...) Violated BTC Protocol: Invalid payload length! .... .... .... .... .... In the debug.log after all of the request spam: mod6@localhost ~ $ grep "getdata stopping" ~/.bitcoin/debug.log getdata stopping at 10724811 bytes Bang. Now we have it. We just hang up if you request more than 10Mb. And bonus they also get banhammered. Next part will be to figure out the tx part.