diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 4 | ||||
-rw-r--r-- | src/main.cpp | 10 | ||||
-rw-r--r-- | src/makefile.vc | 32 | ||||
-rw-r--r-- | src/net.cpp | 4 | ||||
-rw-r--r-- | src/net.h | 2 |
5 files changed, 38 insertions, 14 deletions
diff --git a/src/init.cpp b/src/init.cpp index ebe176a5e4..635799ccf9 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -494,7 +494,9 @@ bool AppInit2(int argc, char* argv[]) } } - if (mapArgs.count("-dnsseed")) + if (GetBoolArg("-nodnsseed")) + printf("DNS seeding disabled\n"); + else DNSAddressSeed(); if (mapArgs.count("-paytxfee")) diff --git a/src/main.cpp b/src/main.cpp index 54902e82eb..699bee2d35 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2040,20 +2040,24 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (pindex) pindex = pindex->pnext; int nLimit = 500 + locator.GetDistanceBack(); + unsigned int nBytes = 0; printf("getblocks %d to %s limit %d\n", (pindex ? pindex->nHeight : -1), hashStop.ToString().substr(0,20).c_str(), nLimit); for (; pindex; pindex = pindex->pnext) { if (pindex->GetBlockHash() == hashStop) { - printf(" getblocks stopping at %d %s\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20).c_str()); + printf(" getblocks stopping at %d %s (%u bytes)\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20).c_str(), nBytes); break; } pfrom->PushInventory(CInv(MSG_BLOCK, pindex->GetBlockHash())); - if (--nLimit <= 0) + CBlock block; + block.ReadFromDisk(pindex, true); + nBytes += block.GetSerializeSize(SER_NETWORK); + if (--nLimit <= 0 || nBytes >= SendBufferSize()/2) { // When this block is requested, we'll send an inv that'll make them // getblocks the next batch of inventory. - printf(" getblocks stopping at limit %d %s\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20).c_str()); + printf(" getblocks stopping at limit %d %s (%u bytes)\n", pindex->nHeight, pindex->GetBlockHash().ToString().substr(0,20).c_str(), nBytes); pfrom->hashContinue = pindex->GetBlockHash(); break; } diff --git a/src/makefile.vc b/src/makefile.vc index 18ced0236e..d5aba3e69f 100644 --- a/src/makefile.vc +++ b/src/makefile.vc @@ -8,29 +8,41 @@ INCLUDEPATHS= \ /I"/db/build_windows" \ /I"/openssl/include" \ /I"/wxwidgets/lib/vc_lib/mswu" \ - /I"/wxwidgets/include" + /I"/wxwidgets/include" / + /I"/miniupnpc" LIBPATHS= \ /LIBPATH:"/boost/stage/lib" \ /LIBPATH:"/db/build_windows/Release" \ /LIBPATH:"/openssl/lib" \ /LIBPATH:"/wxwidgets/lib/vc_lib" \ + /LIBPATH:"/miniupnpc/msvc/Release" \ /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib \ /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib \ /NODEFAULTLIB:msvcrtd.lib WXLIBS=wxmsw29u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib +USE_UPNP=0 + +DEFS=/DWIN32 /D__WXMSW__ /D_WINDOWS /DNOPCH /DNOMINMAX + LIBS= \ libboost_system-vc100-mt.lib \ libboost_filesystem-vc100-mt.lib \ libboost_program_options-vc100-mt.lib \ libboost_thread-vc100-mt.lib \ libdb47s.lib \ - libeay32.lib \ + libeay32.lib + +!IFDEF USE_UPNP +LIBS=$(LIBS) miniupnpc.lib +DEFS=$(DEFS) /DUSE_UPNP=$(USE_UPNP) +!ENDIF + +LIBS=$(LIBS) \ kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib shlwapi.lib -DEFS=/DWIN32 /D__WXMSW__ /D_WINDOWS /DNOPCH DEBUGFLAGS=/Os CFLAGS=/MD /c /nologo /EHsc /GR /Zm300 $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \ @@ -44,10 +56,14 @@ OBJS= \ obj\irc.obj \ obj\main.obj \ obj\rpc.obj \ - obj\init.obj \ + obj\init.obj + +CRYPTOPP_OBJS= \ cryptopp\obj\sha.obj \ cryptopp\obj\cpu.obj +RC=../share + all: bitcoin.exe @@ -81,13 +97,13 @@ cryptopp\obj\sha.obj: cryptopp\sha.cpp cryptopp\obj\cpu.obj: cryptopp\cpu.cpp cl $(CFLAGS) /O2 /DCRYPTOPP_DISABLE_ASM /Fo$@ %s -obj\ui.res: ui.rc rc/bitcoin.ico rc/check.ico rc/send16.bmp rc/send16mask.bmp rc/send16masknoshadow.bmp rc/send20.bmp rc/send20mask.bmp rc/addressbook16.bmp rc/addressbook16mask.bmp rc/addressbook20.bmp rc/addressbook20mask.bmp +obj\ui.res: $(RC)/ui.rc $(RC)/pixmaps/bitcoin.ico $(RC)/pixmaps/check.ico $(RC)/pixmaps/send16.bmp $(RC)/pixmaps/send16mask.bmp $(RC)/pixmaps/send16masknoshadow.bmp $(RC)/pixmaps/send20.bmp $(RC)/pixmaps/send20mask.bmp $(RC)/pixmaps/addressbook16.bmp $(RC)/pixmaps/addressbook16mask.bmp $(RC)/pixmaps/addressbook20.bmp $(RC)/pixmaps/addressbook20mask.bmp rc $(INCLUDEPATHS) $(DEFS) /Fo$@ %s -bitcoin.exe: $(OBJS) obj\ui.obj obj\uibase.obj obj\ui.res +bitcoin.exe: $(OBJS) $(CRYPTOPP_OBJS) obj\ui.obj obj\uibase.obj obj\ui.res link /nologo /SUBSYSTEM:WINDOWS /OUT:$@ $(LIBPATHS) $** $(WXLIBS) $(LIBS) - + .cpp{obj\nogui}.obj: cl $(CFLAGS) /Fo$@ %s @@ -107,7 +123,7 @@ obj\nogui\rpc.obj: $(HEADERS) obj\nogui\init.obj: $(HEADERS) -bitcoind.exe: $(OBJS:obj\=obj\nogui\) obj\ui.res +bitcoind.exe: $(OBJS:obj\=obj\nogui\) $(CRYPTOPP_OBJS) obj\ui.res link /nologo /OUT:$@ $(LIBPATHS) $** $(LIBS) diff --git a/src/net.cpp b/src/net.cpp index 1821530039..e8422a5376 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -915,7 +915,7 @@ void ThreadSocketHandler2(void* parg) CDataStream& vRecv = pnode->vRecv; unsigned int nPos = vRecv.size(); - if (nPos > 1000*GetArg("-maxreceivebuffer", 10*1000)) { + if (nPos > ReceiveBufferSize()) { if (!pnode->fDisconnect) printf("socket recv flood control disconnect (%d bytes)\n", vRecv.size()); pnode->CloseSocketDisconnect(); @@ -980,7 +980,7 @@ void ThreadSocketHandler2(void* parg) pnode->CloseSocketDisconnect(); } } - if (vSend.size() > 1000*GetArg("-maxsendbuffer", 10*1000)) { + if (vSend.size() > SendBufferSize()) { if (!pnode->fDisconnect) printf("socket send flood control disconnect (%d bytes)\n", vSend.size()); pnode->CloseSocketDisconnect(); @@ -23,6 +23,8 @@ extern int nConnectTimeout; +inline unsigned int ReceiveBufferSize() { return 1000*GetArg("-maxreceivebuffer", 10*1000); } +inline unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", 10*1000); } inline unsigned short GetDefaultPort() { return fTestNet ? 18333 : 8333; } static const unsigned int PUBLISH_HOPS = 5; enum |