Research
Timechain
Search Donate
Sponsors
Cake Wallet, private Bitcoin and Monero walletSideShift.ai, no-signup crypto exchangeOrangeRock, non-custodial bitcoin spot and perps tradingBraiins Hashpower, buy and sell Bitcoin hashrateeCash.com
What changed

Bitcoin v0.3.1 → v0.3.2

3 files · +20 · −7 · 4110f33cd · 2010-07-19 · Gavin Andresen

Release commit message: security safeguards, limited addr messages -- version 0.3.2

Previous diff: v0.3.0 → v0.3.1. Next: v0.3.2 → v0.3.3.

main.cpp (modified)

1--- v0.3.1/main.cpp2+++ v0.3.2/main.cpp3@@ -1341,6 +1341,14 @@4     if (nBits != GetNextWorkRequired(pindexPrev))5         return error("AcceptBlock() : incorrect proof of work");6 7+    // Check that the block chain matches the known block chain up to a checkpoint8+    if (pindexPrev->nHeight+1 == 11111 && hash != uint256("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d"))9+        return error("AcceptBlock() : rejected by checkpoint lockin at 11111");10+    if (pindexPrev->nHeight+1 == 33333 && hash != uint256("0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6"))11+        return error("AcceptBlock() : rejected by checkpoint lockin at 33333");12+    if (pindexPrev->nHeight+1 == 68555 && hash != uint256("0x00000000001e1b4903550a0b96e9a9405c8a95f387162e4944e8d9fbe501cd6a"))13+        return error("AcceptBlock() : rejected by checkpoint lockin at 68555");14+15     // Write block to history file16     if (!CheckDiskSpace(::GetSerializeSize(*this, SER_DISK)))17         return error("AcceptBlock() : out of disk space");18@@ -1933,6 +1941,8 @@19         vRecv >> vAddr;20         if (pfrom->nVersion < 200) // don't want addresses from 0.1.521             return true;22+        if (pfrom->nVersion < 209 && mapAddresses.size() > 1000) // don't want addr from 0.2.0 unless seeding23+            return true;24         if (vAddr.size() > 1000)25             return error("message addr size() = %d", vAddr.size());26 27@@ -1941,6 +1951,9 @@28         {29             if (fShutdown)30                 return true;31+            // ignore IPv6 for now, since it isn't implemented anyway32+            if (!addr.IsIPv4())33+                continue;34             addr.nTime = GetAdjustedTime() - 2 * 60 * 60;35             if (pfrom->fGetAddr || vAddr.size() > 10)36                 addr.nTime -= 5 * 24 * 60 * 60;37@@ -1952,15 +1965,15 @@38                 CRITICAL_BLOCK(cs_vNodes)39                 {40                     // Use deterministic randomness to send to41-                    // the same places for an hour at a time42+                    // the same places for 12 hours at a time43                     static uint256 hashSalt;44                     if (hashSalt == 0)45                         RAND_bytes((unsigned char*)&hashSalt, sizeof(hashSalt));46-                    uint256 hashRand = addr.ip ^ (GetTime()/3600) ^ hashSalt;47+                    uint256 hashRand = addr.ip ^ ((GetTime()+addr.ip)/(12*60*60)) ^ hashSalt;48                     multimap<uint256, CNode*> mapMix;49                     foreach(CNode* pnode, vNodes)50                         mapMix.insert(make_pair(hashRand = Hash(BEGIN(hashRand), END(hashRand)), pnode));51-                    int nRelayNodes = 10; // reduce this to 5 when the network is large52+                    int nRelayNodes = 4;53                     for (multimap<uint256, CNode*>::iterator mi = mapMix.begin(); mi != mapMix.end() && nRelayNodes-- > 0; ++mi)54                         ((*mi).second)->PushAddress(addr);55                 }

serialize.h (modified)

1--- v0.3.1/serialize.h2+++ v0.3.2/serialize.h3@@ -19,7 +19,7 @@4 class CDataStream;5 class CAutoFile;6 7-static const int VERSION = 301;8+static const int VERSION = 302;9 static const char* pszSubVer = "";10 11 

setup.nsi (modified)

1--- v0.3.1/setup.nsi2+++ v0.3.2/setup.nsi3@@ -7,7 +7,7 @@4 5 # General Symbol Definitions6 !define REGKEY "SOFTWARE\$(^Name)"7-!define VERSION 0.3.18+!define VERSION 0.3.29 !define COMPANY "Bitcoin project"10 !define URL http://www.bitcoin.org/11 12@@ -42,12 +42,12 @@13 !insertmacro MUI_LANGUAGE English14 15 # Installer attributes16-OutFile bitcoin-0.3.1-win32-setup.exe17+OutFile bitcoin-0.3.2-win32-setup.exe18 InstallDir $PROGRAMFILES\Bitcoin19 CRCCheck on20 XPStyle on21 ShowInstDetails show22-VIProductVersion 0.3.1.023+VIProductVersion 0.3.2.024 VIAddVersionKey ProductName Bitcoin25 VIAddVersionKey ProductVersion "${VERSION}"26 VIAddVersionKey CompanyName "${COMPANY}"
0:000:00