comparison src/main.cpp @ 3670:b6cce4a9d9ee draft

change blockchain -> block chain (spelling) - Wiki says "block chain" is correct ;) - remove some unneeded spaces I found in the source, while fixing the spelling
author Philip Kaufmann <phil.kaufmann@t-online.de>
date Fri, 05 Oct 2012 19:22:21 +0200 (2012-10-05)
parents 5775e2d81a90
children 41a54b4e95b2
comparison
equal deleted inserted replaced
3669:c1f6a411885b 3670:b6cce4a9d9ee
1289 return true; 1289 return true;
1290 } 1290 }
1291 1291
1292 bool CTransaction::HaveInputs(CCoinsViewCache &inputs) const 1292 bool CTransaction::HaveInputs(CCoinsViewCache &inputs) const
1293 { 1293 {
1294 if (!IsCoinBase()) { 1294 if (!IsCoinBase()) {
1295 // first check whether information about the prevout hash is available 1295 // first check whether information about the prevout hash is available
1296 for (unsigned int i = 0; i < vin.size(); i++) { 1296 for (unsigned int i = 0; i < vin.size(); i++) {
1297 const COutPoint &prevout = vin[i].prevout; 1297 const COutPoint &prevout = vin[i].prevout;
1298 if (!inputs.HaveCoins(prevout.hash)) 1298 if (!inputs.HaveCoins(prevout.hash))
1299 return false; 1299 return false;
1354 // The first loop above does all the inexpensive checks. 1354 // The first loop above does all the inexpensive checks.
1355 // Only if ALL inputs pass do we perform expensive ECDSA signature checks. 1355 // Only if ALL inputs pass do we perform expensive ECDSA signature checks.
1356 // Helps prevent CPU exhaustion attacks. 1356 // Helps prevent CPU exhaustion attacks.
1357 1357
1358 // Skip ECDSA signature verification when connecting blocks 1358 // Skip ECDSA signature verification when connecting blocks
1359 // before the last blockchain checkpoint. This is safe because block merkle hashes are 1359 // before the last block chain checkpoint. This is safe because block merkle hashes are
1360 // still computed and checked, and any change will be caught at the next checkpoint. 1360 // still computed and checked, and any change will be caught at the next checkpoint.
1361 if (csmode == CS_ALWAYS || 1361 if (csmode == CS_ALWAYS ||
1362 (csmode == CS_AFTER_CHECKPOINT && inputs.GetBestBlock()->nHeight >= Checkpoints::GetTotalBlocksEstimate())) { 1362 (csmode == CS_AFTER_CHECKPOINT && inputs.GetBestBlock()->nHeight >= Checkpoints::GetTotalBlocksEstimate())) {
1363 for (unsigned int i = 0; i < vin.size(); i++) { 1363 for (unsigned int i = 0; i < vin.size(); i++) {
1364 const COutPoint &prevout = vin[i].prevout; 1364 const COutPoint &prevout = vin[i].prevout;
1365 const CCoins &coins = inputs.GetCoins(prevout.hash); 1365 const CCoins &coins = inputs.GetCoins(prevout.hash);
1366 1366
1618 CDiskBlockIndex blockindex(pindex); 1618 CDiskBlockIndex blockindex(pindex);
1619 if (!pblocktree->WriteBlockIndex(blockindex)) 1619 if (!pblocktree->WriteBlockIndex(blockindex))
1620 return error("ConnectBlock() : WriteBlockIndex failed"); 1620 return error("ConnectBlock() : WriteBlockIndex failed");
1621 } 1621 }
1622 1622
1623 // add this block to the view's blockchain 1623 // add this block to the view's block chain
1624 if (!view.SetBestBlock(pindex)) 1624 if (!view.SetBestBlock(pindex))
1625 return false; 1625 return false;
1626 1626
1627 // Watch for transactions paying to me 1627 // Watch for transactions paying to me
1628 for (unsigned int i=0; i<vtx.size(); i++) 1628 for (unsigned int i=0; i<vtx.size(); i++)
2256 // Load block file info 2256 // Load block file info
2257 pblocktree->ReadLastBlockFile(nLastBlockFile); 2257 pblocktree->ReadLastBlockFile(nLastBlockFile);
2258 printf("LoadBlockIndex(): last block file = %i\n", nLastBlockFile); 2258 printf("LoadBlockIndex(): last block file = %i\n", nLastBlockFile);
2259 if (pblocktree->ReadBlockFileInfo(nLastBlockFile, infoLastBlockFile)) 2259 if (pblocktree->ReadBlockFileInfo(nLastBlockFile, infoLastBlockFile))
2260 printf("LoadBlockIndex(): last block file: %s\n", infoLastBlockFile.ToString().c_str()); 2260 printf("LoadBlockIndex(): last block file: %s\n", infoLastBlockFile.ToString().c_str());
2261 2261
2262 // Load hashBestChain pointer to end of best chain 2262 // Load hashBestChain pointer to end of best chain
2263 pindexBest = pcoinsTip->GetBestBlock(); 2263 pindexBest = pcoinsTip->GetBestBlock();
2264 if (pindexBest == NULL) 2264 if (pindexBest == NULL)
2265 { 2265 {
2266 if (pindexGenesisBlock == NULL) 2266 if (pindexGenesisBlock == NULL)