tree checksum vpatch file split hunks

all signers: mod6

antecedents: genesis bitcoin-asciilifeform.1

press order:

genesismod6
bitcoin-asciilifeform.1mod6
rm_rf_upnpmod6

patch:

- E5CAAE03E3AC4A66240BEF7EAAE55CB4F42B1D81EDA2CB2AF5EC0F2E36B4371DFCA10D3A004FBF041CE85FA2C588534E0629A41AA31D3BB4A0A280221252AD11
+ D6224A6FE15BD7712174FD0D420D8B289204712D5CBDE94AEF0CC6EF96EC2FE60AABE4CD71360D32A2464E87C6BFAFF59D0464FDE880302BB8180DEA4371CE57
bitcoin/src/db.cpp
(927 . 7)(927 . 6)
5 if (strKey == "fMinimizeOnClose") ssValue >> fMinimizeOnClose;
6 if (strKey == "fUseProxy") ssValue >> fUseProxy;
7 if (strKey == "addrProxy") ssValue >> addrProxy;
8 if (fHaveUPnP && strKey == "fUseUPnP") ssValue >> fUseUPnP;
9 }
10 else if (strType == "minversion")
11 {
(950 . 9)(949 . 6)
13 printf("fMinimizeOnClose = %d\n", fMinimizeOnClose);
14 printf("fUseProxy = %d\n", fUseProxy);
15 printf("addrProxy = %s\n", addrProxy.ToString().c_str());
16 if (fHaveUPnP)
17 printf("fUseUPnP = %d\n", fUseUPnP);
18
19
20 // Rewrite encrypted wallets of versions 0.4.0 and 0.5.0rc:
21 if (fIsEncrypted && (nFileVersion == 40000 || nFileVersion == 50000))
- 5954C41570791ED6A4012660F36523D5DE96C502FC5960046B8D844DCCF51CC92F39ECA4748BD52443BB556E79E7895B51C8DA297F468F063115FC7FA9060BB1
+ B94202848156190628DDC0602EC88642916C827888164B435F09433F67B60F37CB43F6D4C6E6769AF7AD39E9ADEC3163BF641D0AC5879F16B7578E4B8E827D66
bitcoin/src/init.cpp
(188 . 13)(188 . 6)
26 " -bantime=<n> \t " + _("Number of seconds to keep misbehaving peers from reconnecting (default: 86400)\n") +
27 " -maxreceivebuffer=<n>\t " + _("Maximum per-connection receive buffer, <n>*1000 bytes (default: 10000)\n") +
28 " -maxsendbuffer=<n>\t " + _("Maximum per-connection send buffer, <n>*1000 bytes (default: 10000)\n") +
29 #ifdef USE_UPNP
30 #if USE_UPNP
31 " -noupnp \t " + _("Don't attempt to use UPnP to map the listening port\n") +
32 #else
33 " -upnp \t " + _("Attempt to use UPnP to map the listening port\n") +
34 #endif
35 #endif
36 " -paytxfee=<amt> \t " + _("Fee per kB to add to transactions you send\n") +
37 #if !defined(WIN32)
38 " -daemon \t\t " + _("Run in the background as a daemon and accept commands\n") +
(460 . 8)(453 . 6)
40 SoftSetArg("-nolisten", true);
41 SoftSetArg("-noirc", true);
42 SoftSetArg("-nodnsseed", true);
43 SoftSetArg("-noupnp", true);
44 SoftSetArg("-upnp", false);
45 SoftSetArg("-dns", false);
46 }
47
(469 . 10)(460 . 6)
49 fNoListen = GetBoolArg("-nolisten");
50
51 // Command-line args override in-wallet settings:
52 if (mapArgs.count("-upnp"))
53 fUseUPnP = GetBoolArg("-upnp");
54 else if (mapArgs.count("-noupnp"))
55 fUseUPnP = !GetBoolArg("-noupnp");
56
57 if (!fNoListen)
58 {
- 7E326DCBF51E51C301521358CF2E684840D4FC5C977F0EA8476C3DEDD8E91E90548D8240608B76C1FD90F832EC11C1D3F57626948EEFC43F244DAF869475FE31
+ 8D9B3EA74202849015588E2EE34549F95D8BC172AC3AEB15C328BC78B10A5FA85006DB37922CC5F0769468FABBBCD0B5271D5656D3FC8BB3DEAA8CD98A0AF980
bitcoin/src/main.cpp
(57 . 11)(57 . 6)
63 int nLimitProcessors = 1;
64 int fMinimizeToTray = true;
65 int fMinimizeOnClose = true;
66 #if USE_UPNP
67 int fUseUPnP = true;
68 #else
69 int fUseUPnP = false;
70 #endif
71
72
73 //////////////////////////////////////////////////////////////////////////////
- 67B6643036F41A20FEE9D90D36EE22EEC8B153BAD6EFB2342C3AD887523385F089945FDAC74E73C5973D04AE1C748BCA15B3D7F5B9D1243B8F87A4E6BDA5F3C2
+ 110908F2C5982131591B43888D7F087848746914E5AEBF96E1809219E9C073FCF4665695E3ACFD85ED1AD2126B452749273BC70AF0536A773B08A1D55575012D
bitcoin/src/main.h
(40 . 11)(40 . 6)
78 static const int COINBASE_MATURITY = 100;
79 // Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp.
80 static const int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC
81 #ifdef USE_UPNP
82 static const int fHaveUPnP = true;
83 #else
84 static const int fHaveUPnP = false;
85 #endif
86
87
88
(74 . 7)(69 . 6)
90 extern int nLimitProcessors;
91 extern int fMinimizeToTray;
92 extern int fMinimizeOnClose;
93 extern int fUseUPnP;
94
95
96
- 4B7074D3A08D375347F9534DFB9D5A623E443A04E68A739CA780A569E5B5E91B0EB2C683233A72ACAB8AF08825C29EB731270E065BF37F4D487251ABDF15AD78
+ 655FDD6D8E0C4A783D81C2E8A996F2197D3EF48593BFFBF5446D6940D9065150CAC12CBA72BB1BEBDEFB92CCA4CDBFCDE515CCDC5279AA375545AC2ECAED07BA
bitcoin/src/makefile.linux-mingw
(4 . 8)(4 . 6)
101
102 DEPSDIR:=/usr/i586-mingw32msvc
103
104 USE_UPNP:=0
105
106 INCLUDEPATHS= \
107 -I"$(DEPSDIR)/boost_1_47_0" \
108 -I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
(53 . 11)(51 . 6)
110 wallet.h
111
112
113 ifdef USE_UPNP
114 LIBPATHS += -L"$(DEPSDIR)/miniupnpc"
115 LIBS += -l miniupnpc -l iphlpapi
116 DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
117 endif
118
119 LIBS += -l mingwthrd -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l shlwapi
120
- DB27FA66049B17C4C68621529AD41DE8973051762F0A0A96DD87FD9C7D7801FEFB338342CE262124A0623EE319BF05CB3E25B5EB0CB50E27A918409EF90CA96A
+ 99AA39376BCE4D549A2C8B442F48814A4987EB6B329BF7541322BBF90449882016313E6BA15738DF617F0535E60C1E1C1B18552AED035C6B69E726514D648E7A
bitcoin/src/makefile.unix
(2 . 8)(2 . 6)
125 # Distributed under the MIT/X11 software license, see the accompanying
126 # file license.txt or http://www.opensource.org/licenses/mit-license.php.
127
128 USE_UPNP:=0
129
130 DEFS=-DNOPCH
131
132 DEFS += $(addprefix -I,$(BOOST_INCLUDE_PATH) $(BDB_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH))
(31 . 14)(29 . 6)
134 -l ssl \
135 -l crypto
136
137 ifndef USE_UPNP
138 override USE_UPNP = -
139 endif
140 ifneq (${USE_UPNP}, -)
141 LIBS += -l miniupnpc
142 DEFS += -DUSE_UPNP=$(USE_UPNP)
143 endif
144
145 ifneq (${USE_SSL}, 0)
146 DEFS += -DUSE_SSL
147 endif
- E76F8111F2C74A992113F6B9691407F6F14E2D37920516727EDF7F78FDAF7A4E4D42C3378B46C0B5EAB7F45DE7E375ACDEB6AFB9C33725E7081760D15338E281
+ A1B78A422161C6F5F3CA51A585D8C3F68E9490AF3F1BA48B7772CBE4D5A9711619707984376F9A51487AEC676F437FBF6DF38309D535DACCB966873F9608E9F1
bitcoin/src/net.cpp
(14 . 12)(14 . 6)
152 #include <string.h>
153 #endif
154
155 #ifdef USE_UPNP
156 #include <miniupnpc/miniwget.h>
157 #include <miniupnpc/miniupnpc.h>
158 #include <miniupnpc/upnpcommands.h>
159 #include <miniupnpc/upnperrors.h>
160 #endif
161
162 using namespace std;
163 using namespace boost;
(29 . 9)(23 . 6)
165 void ThreadMessageHandler2(void* parg);
166 void ThreadSocketHandler2(void* parg);
167 void ThreadOpenConnections2(void* parg);
168 #ifdef USE_UPNP
169 void ThreadMapPort2(void* parg);
170 #endif
171 void ThreadDNSAddressSeed2(void* parg);
172 bool OpenNetworkConnection(const CAddress& addrConnect);
173
(1110 . 153)(1101 . 6)
175
176
177
178 #ifdef USE_UPNP
179 void ThreadMapPort(void* parg)
180 {
181 IMPLEMENT_RANDOMIZE_STACK(ThreadMapPort(parg));
182 try
183 {
184 vnThreadsRunning[5]++;
185 ThreadMapPort2(parg);
186 vnThreadsRunning[5]--;
187 }
188 catch (std::exception& e) {
189 vnThreadsRunning[5]--;
190 PrintException(&e, "ThreadMapPort()");
191 } catch (...) {
192 vnThreadsRunning[5]--;
193 PrintException(NULL, "ThreadMapPort()");
194 }
195 printf("ThreadMapPort exiting\n");
196 }
197
198 void ThreadMapPort2(void* parg)
199 {
200 printf("ThreadMapPort started\n");
201
202 char port[6];
203 sprintf(port, "%d", GetListenPort());
204
205 const char * multicastif = 0;
206 const char * minissdpdpath = 0;
207 struct UPNPDev * devlist = 0;
208 char lanaddr[64];
209
210 #ifndef UPNPDISCOVER_SUCCESS
211 /* miniupnpc 1.5 */
212 devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0);
213 #else
214 /* miniupnpc 1.6 */
215 int error = 0;
216 devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error);
217 #endif
218
219 struct UPNPUrls urls;
220 struct IGDdatas data;
221 int r;
222
223 r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
224 if (r == 1)
225 {
226 if (!addrLocalHost.IsRoutable())
227 {
228 char externalIPAddress[40];
229 r = UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIPAddress);
230 if(r != UPNPCOMMAND_SUCCESS)
231 printf("UPnP: GetExternalIPAddress() returned %d\n", r);
232 else
233 {
234 if(externalIPAddress[0])
235 {
236 printf("UPnP: ExternalIPAddress = %s\n", externalIPAddress);
237 CAddress addrExternalFromUPnP(externalIPAddress, 0, false, nLocalServices);
238 if (addrExternalFromUPnP.IsRoutable())
239 addrLocalHost = addrExternalFromUPnP;
240 }
241 else
242 printf("UPnP: GetExternalIPAddress failed.\n");
243 }
244 }
245
246 string strDesc = "Bitcoin " + FormatFullVersion();
247 #ifndef UPNPDISCOVER_SUCCESS
248 /* miniupnpc 1.5 */
249 r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
250 port, port, lanaddr, strDesc.c_str(), "TCP", 0);
251 #else
252 /* miniupnpc 1.6 */
253 r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
254 port, port, lanaddr, strDesc.c_str(), "TCP", 0, "0");
255 #endif
256
257 if(r!=UPNPCOMMAND_SUCCESS)
258 printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n",
259 port, port, lanaddr, r, strupnperror(r));
260 else
261 printf("UPnP Port Mapping successful.\n");
262 int i = 1;
263 loop {
264 if (fShutdown || !fUseUPnP)
265 {
266 r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port, "TCP", 0);
267 printf("UPNP_DeletePortMapping() returned : %d\n", r);
268 freeUPNPDevlist(devlist); devlist = 0;
269 FreeUPNPUrls(&urls);
270 return;
271 }
272 if (i % 600 == 0) // Refresh every 20 minutes
273 {
274 #ifndef UPNPDISCOVER_SUCCESS
275 /* miniupnpc 1.5 */
276 r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
277 port, port, lanaddr, strDesc.c_str(), "TCP", 0);
278 #else
279 /* miniupnpc 1.6 */
280 r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
281 port, port, lanaddr, strDesc.c_str(), "TCP", 0, "0");
282 #endif
283
284 if(r!=UPNPCOMMAND_SUCCESS)
285 printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n",
286 port, port, lanaddr, r, strupnperror(r));
287 else
288 printf("UPnP Port Mapping successful.\n");;
289 }
290 Sleep(2000);
291 i++;
292 }
293 } else {
294 printf("No valid UPnP IGDs found\n");
295 freeUPNPDevlist(devlist); devlist = 0;
296 if (r != 0)
297 FreeUPNPUrls(&urls);
298 loop {
299 if (fShutdown || !fUseUPnP)
300 return;
301 Sleep(2000);
302 }
303 }
304 }
305
306 void MapPort(bool fMapPort)
307 {
308 if (fUseUPnP != fMapPort)
309 {
310 fUseUPnP = fMapPort;
311 WriteSetting("fUseUPnP", fUseUPnP);
312 }
313 if (fUseUPnP && vnThreadsRunning[5] < 1)
314 {
315 if (!CreateThread(ThreadMapPort, NULL))
316 printf("Error: ThreadMapPort(ThreadMapPort) failed\n");
317 }
318 }
319 #else
320 void MapPort(bool /* unused fMapPort */)
321 {
322 // Intentionally left blank.
323 }
324 #endif
325
326
327
(1872 . 10)(1716 . 6)
329 if (!CreateThread(ThreadDNSAddressSeed, NULL))
330 printf("Error: CreateThread(ThreadDNSAddressSeed) failed\n");
331
332 // Map ports with UPnP
333 if (fHaveUPnP)
334 MapPort(fUseUPnP);
335
336 // Get addresses from IRC and advertise ours
337 if (!CreateThread(ThreadIRCSeed, NULL))
338 printf("Error: CreateThread(ThreadIRCSeed) failed\n");
(1903 . 9)(1743 . 6)
340 nTransactionsUpdated++;
341 int64 nStart = GetTime();
342 while (vnThreadsRunning[0] > 0 || vnThreadsRunning[1] > 0 || vnThreadsRunning[2] > 0 || vnThreadsRunning[3] > 0 || vnThreadsRunning[4] > 0
343 #ifdef USE_UPNP
344 || vnThreadsRunning[5] > 0
345 #endif
346 )
347 {
348 if (GetTime() - nStart > 20)
(1917 . 7)(1754 . 6)
350 if (vnThreadsRunning[2] > 0) printf("ThreadMessageHandler still running\n");
351 if (vnThreadsRunning[3] > 0) printf("ThreadBitcoinMiner still running\n");
352 if (vnThreadsRunning[4] > 0) printf("ThreadRPCServer still running\n");
353 if (fHaveUPnP && vnThreadsRunning[5] > 0) printf("ThreadMapPort still running\n");
354 if (vnThreadsRunning[6] > 0) printf("ThreadDNSAddressSeed still running\n");
355 while (vnThreadsRunning[2] > 0 || vnThreadsRunning[4] > 0)
356 Sleep(20);