tree checksum vpatch file split hunks
all signers: mircea_popescu trinque asciilifeform ben_vulpes mod6
antecedents: asciilifeform_dns_thermonyukyoolar_kleansing asciilifeform_tx-orphanage_amputation asciilifeform_and_now_we_have_eatblock genesis
press order:
patch:
(252 . 14)(252 . 14)- 86E836B4710A5F675AF7F13832F290F9B9C9F24D3EFB41733D55E3A4F3F518E8C9FB1D60B43A2FBA3C8327BD2B9D10E5EBBB6DF8159F06873AEC21D2B9123304
5 };
6
7 // base58-encoded bitcoin addresses
8 // Addresses have version 0 or 111 (testnet)
9 // Addresses have version 0
10 // The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key
11 class CBitcoinAddress : public CBase58Data
12 {
13 public:
14 bool SetHash160(const uint160& hash160)
15 {
16 SetData(fTestNet ? 111 : 0, &hash160, 20);
17 SetData(0, &hash160, 20);
18 return true;
19 }
20
(271 . 20)(271 . 15)
22 bool IsValid() const
23 {
24 int nExpectedSize = 20;
25 bool fExpectTestNet = false;
26 switch(nVersion)
27 {
28 case 0:
29 break;
30
31 case 111:
32 fExpectTestNet = true;
33 break;
34
35 default:
36 return false;
37 }
38 return fExpectTestNet == fTestNet && vchData.size() == nExpectedSize;
39 return vchData.size() == nExpectedSize;
40 }
41
42 CBitcoinAddress()
(303 . 7)(303 . 6)
47 obj.push_back(Pair("genproclimit", (int)(fLimitProcessors ? nLimitProcessors : -1)));
48 obj.push_back(Pair("difficulty", (double)GetDifficulty()));
49 obj.push_back(Pair("hashespersec", gethashespersec(params, false)));
50 obj.push_back(Pair("testnet", fTestNet));
51 obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime()));
52 obj.push_back(Pair("keypoolsize", pwalletMain->GetKeyPoolSize()));
53 obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee)));
- 0B7CA89FD0A4045EF9553FF439C4FD39DDDD92069CA97B29DECBC31D2F96A004E0015B453DBF4C4669555ED997FFD02F1066C43F346FEB8CD0ADE0B80772E863(35 . 8)(35 . 6)- C3EE100D52ACBF91D3355C95EDC63DB6E1D8E4FB1847EBFFFBB8C8FE059EA88FA2F6C9E1535526039BBA6CC9B4E03B4CC5624FD28004ED7AEDCF6A0F42B3E177
58
59 bool CheckBlock(int nHeight, const uint256& hash)
60 {
61 if (fTestNet) return true; // Testnet has no checkpoints
62
63 MapCheckpoints::const_iterator i = mapCheckpoints.find(nHeight);
64 if (i == mapCheckpoints.end()) return true;
65 return hash == i->second;
(44 . 15)(42 . 11)
67
68 int GetTotalBlocksEstimate()
69 {
70 if (fTestNet) return 0;
71
72 return mapCheckpoints.rbegin()->first;
73 }
74
75 CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex)
76 {
77 if (fTestNet) return NULL;
78
79 BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, mapCheckpoints)
80 {
81 const uint256& hash = i.second;
(160 . 7)(160 . 7)- 18A4B9A7ABCCAC46895C8EEB0C14CC502F3743958654444C87D5192A51073980858750DAA9C8BD67F4D4D2EC8A7117AEA8FC75A4ACF73CC1A2CAB996AEA324B1
86 " -datadir=<dir> \t\t " + _("Specify data directory\n") +
87 " -timeout=<n> \t " + _("Specify connection timeout (in milliseconds)\n") +
88 " -proxy=<ip:port> \t " + _("Connect through socks4 proxy\n") +
89 " -port=<port> \t\t " + _("Listen for connections on <port> (default: 8333 or testnet: 18333)\n") +
90 " -port=<port> \t\t " + _("Listen for connections on <port> (default: 8333)\n") +
91 " -maxconnections=<n>\t " + _("Maintain at most <n> connections to peers (default: 125)\n") +
92 " -myip=<ip> \t " + _("Set this node's external IP address.\n") +
93 " -addnode=<ip> \t " + _("Add a node to connect to\n") +
(172 . 7)(172 . 6)
95 " -maxsendbuffer=<n>\t " + _("Maximum per-connection send buffer, <n>*1000 bytes (default: 10000)\n") +
96 " -paytxfee=<amt> \t " + _("Fee per kB to add to transactions you send\n") +
97 " -daemon \t\t " + _("Run in the background as a daemon and accept commands\n") +
98 " -testnet \t\t " + _("Use the test network\n") +
99 " -debug \t\t " + _("Output extra debugging information\n") +
100 " -caneat \t\t " + _("Permit the use of 'eatblock'\n") +
101 " -logtimestamps \t " + _("Prepend debug output with timestamp\n") +
(194 . 7)(193 . 6)
103 return false;
104 }
105
106 fTestNet = GetBoolArg("-testnet");
107 fDebug = GetBoolArg("-debug");
108 fDaemon = GetBoolArg("-daemon");
109 fCanEat = GetBoolArg("-caneat");
(311 . 8)(311 . 8)- 788E0529775E119DBCA114DD28E76B8B83CEEF9870E140EDD9140E8FBE61BBA1213F174708A2CC8E3CEB8C839A40F8FDE98A419E07C3A0FE37979E6109E4EC61
114 if (GetSigOpCount() > nSize / 34 || nSize < 100)
115 return error("AcceptToMemoryPool() : transaction with out-of-bounds SigOpCount");
116
117 // Rather not work on nonstandard transactions (unless -testnet)
118 if (!fTestNet && !IsStandard())
119 // Rather not work on nonstandard transactions
120 if (!IsStandard())
121 return error("AcceptToMemoryPool() : nonstandard transaction type");
122
123 // Do we already have it?
(600 . 11)(600 . 6)
125 //
126 unsigned int ComputeMinWork(unsigned int nBase, int64 nTime)
127 {
128 // Testnet has min-difficulty blocks
129 // after nTargetSpacing*2 time between blocks:
130 if (fTestNet && nTime > nTargetSpacing*2)
131 return bnProofOfWorkLimit.GetCompact();
132
133 CBigNum bnResult;
134 bnResult.SetCompact(nBase);
135 while (nTime > 0 && bnResult < bnProofOfWorkLimit)
(630 . 23)(625 . 6)
137 // Only change once per interval
138 if ((pindexLast->nHeight+1) % nInterval != 0)
139 {
140 // Special rules for testnet after 15 Feb 2012:
141 if (fTestNet && pblock->nTime > 1329264000)
142 {
143 // If the new block's timestamp is more than 2* 10 minutes
144 // then allow mining of a min-difficulty block.
145 if (pblock->nTime - pindexLast->nTime > nTargetSpacing*2)
146 return nProofOfWorkLimit;
147 else
148 {
149 // Return the last non-special-min-difficulty-rules-block
150 const CBlockIndex* pindex = pindexLast;
151 while (pindex->pprev && pindex->nHeight % nInterval != 0 && pindex->nBits == nProofOfWorkLimit)
152 pindex = pindex->pprev;
153 return pindex->nBits;
154 }
155 }
156
157 return pindexLast->nBits;
158 }
159
(992 . 8)(970 . 7)
161 // This logic is not necessary for memory pool transactions, as AcceptToMemoryPool
162 // already refuses previously-known transaction id's entirely.
163 // This rule applies to all blocks whose timestamp is after March 15, 2012, 0:00 UTC.
164 // On testnet it is enabled as of februari 20, 2012, 0:00 UTC.
165 if (pindex->nTime > 1331769600 || (fTestNet && pindex->nTime > 1329696000))
166 if (pindex->nTime > 1331769600)
167 BOOST_FOREACH(CTransaction& tx, vtx)
168 {
169 CTxIndex txindexOld;
(1461 . 16)(1438 . 6)
171
172 bool LoadBlockIndex(bool fAllowNew)
173 {
174 if (fTestNet)
175 {
176 hashGenesisBlock = uint256("0x00000007199508e34a9ff81e6ec0c477a4cccff2a4767a8eee39c11db367b008");
177 bnProofOfWorkLimit = CBigNum(~uint256(0) >> 28);
178 pchMessageStart[0] = 0xfa;
179 pchMessageStart[1] = 0xbf;
180 pchMessageStart[2] = 0xb5;
181 pchMessageStart[3] = 0xda;
182 }
183
184 //
185 // Load block index
186 //
(1511 . 13)(1478 . 6)
188 block.nBits = 0x1d00ffff;
189 block.nNonce = 2083236893;
190
191 if (fTestNet)
192 {
193 block.nTime = 1296688602;
194 block.nBits = 0x1d07fff8;
195 block.nNonce = 384568319;
196 }
197
198 //// debug print
199 printf("%s\n", block.GetHash().ToString().c_str());
200 printf("%s\n", hashGenesisBlock.ToString().c_str());
(14 . 10)(14 . 9)
205 #include <string>
206 #include "uint256.h"
207
208 extern bool fTestNet;
209 static inline unsigned short GetDefaultPort(const bool testnet = fTestNet)
210 static inline unsigned short GetDefaultPort()
211 {
212 return testnet ? 18333 : 8333;
213 return 8333;
214 }
215
216 //
- B801E7F75CA5C3B9463ABE07201B60D4425CBA761D34F70B18ADCCA7370F341B90B91E8CAFD9FB28407439C72B4A624B10862FB22A301C9EA88F79D44267C0F7(28 . 7)(28 . 6)- B81E7C3EB43EB18D226C7A0EBB5868CC793C7197318BF7954590136B9713CAC00C9F44FC90578C52F86D424B272C2A78C0FC7A55B23B566CC0C859D4C699983C
221 bool fServer = false;
222 bool fCommandLine = false;
223 string strMiscWarning;
224 bool fTestNet = false;
225 bool fNoListen = false;
226 bool fLogTimestamps = false;
227
(685 . 14)(684 . 6)
229 strlcpy(pszDir, pszCachedDir, MAX_PATH);
230 nVariation = 1;
231 }
232 if (fTestNet)
233 {
234 char* p = pszDir + strlen(pszDir);
235 if (p > pszDir && p[-1] != '/' && p[-1] != '\\')
236 *p++ = '/';
237 strcpy(p, "testnet");
238 nVariation += 2;
239 }
240 static bool pfMkdir[4];
241 if (!pfMkdir[nVariation])
242 {
(118 . 7)(118 . 6)
247 extern bool fServer;
248 extern bool fCommandLine;
249 extern std::string strMiscWarning;
250 extern bool fTestNet;
251 extern bool fNoListen;
252 extern bool fLogTimestamps;
253