Merge pull request #1632 from luke-jr/spelling

Fix spelling and grammar errors
This commit is contained in:
Jeff Garzik 2012-08-01 10:56:47 -07:00
commit f81e6f779b
39 changed files with 97 additions and 97 deletions

View File

@ -203,7 +203,7 @@ TAB_SIZE = 8
# For example adding "sideeffect=\par Side Effects:\n" will allow you to # For example adding "sideeffect=\par Side Effects:\n" will allow you to
# put the command \sideeffect (or @sideeffect) in the documentation, which # put the command \sideeffect (or @sideeffect) in the documentation, which
# will result in a user-defined paragraph with heading "Side Effects:". # will result in a user-defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines. # You can put \n in the value part of an alias to insert newlines.
ALIASES = ALIASES =

View File

@ -56,8 +56,8 @@ config file):
HiddenServiceDir /var/lib/tor/bitcoin-service/ HiddenServiceDir /var/lib/tor/bitcoin-service/
HiddenServicePort 8333 127.0.0.1:8333 HiddenServicePort 8333 127.0.0.1:8333
The directory can be different of course, but (both) 8333's should be equal to your The directory can be different of course, but (both) port numbers should be equal to
bitcoind's P2P listen port (8333 by default). your bitcoind's P2P listen port (8333 by default).
-externalip=X You can tell bitcoin about its publicly reachable address using -externalip=X You can tell bitcoin about its publicly reachable address using
this option, and this can be a .onion address. Given the above this option, and this can be a .onion address. Given the above

View File

@ -12,9 +12,9 @@ make -f makefile.unix test_bitcoin # Replace makefile.unix if you're not on uni
If all tests succeed the last line of output will be: If all tests succeed the last line of output will be:
*** No errors detected *** No errors detected
To add more tests, add BOOST_AUTO_TEST_CASE's to the existing To add more tests, add BOOST_AUTO_TEST_CASE functions to the existing
.cpp files in the test/ directory or add new .cpp files that .cpp files in the test/ directory or add new .cpp files that
implement new BOOST_AUTO_TEST_SUITE's (the makefiles are implement new BOOST_AUTO_TEST_SUITE sections (the makefiles are
set up to add test/*.cpp to test_bitcoin automatically). set up to add test/*.cpp to test_bitcoin automatically).

View File

@ -117,7 +117,7 @@ public:
// * Bucket selection is based on cryptographic hashing, using a randomly-generated 256-bit key, which should not // * Bucket selection is based on cryptographic hashing, using a randomly-generated 256-bit key, which should not
// be observable by adversaries. // be observable by adversaries.
// * Several indexes are kept for high performance. Defining DEBUG_ADDRMAN will introduce frequent (and expensive) // * Several indexes are kept for high performance. Defining DEBUG_ADDRMAN will introduce frequent (and expensive)
// consistency checks for the entire datastructure. // consistency checks for the entire data structure.
// total number of buckets for tried addresses // total number of buckets for tried addresses
#define ADDRMAN_TRIED_BUCKET_COUNT 64 #define ADDRMAN_TRIED_BUCKET_COUNT 64
@ -174,13 +174,13 @@ private:
// last used nId // last used nId
int nIdCount; int nIdCount;
// table with information about all nId's // table with information about all nIds
std::map<int, CAddrInfo> mapInfo; std::map<int, CAddrInfo> mapInfo;
// find an nId based on its network address // find an nId based on its network address
std::map<CNetAddr, int> mapAddr; std::map<CNetAddr, int> mapAddr;
// randomly-ordered vector of all nId's // randomly-ordered vector of all nIds
std::vector<int> vRandom; std::vector<int> vRandom;
// number of "tried" entries // number of "tried" entries
@ -253,8 +253,8 @@ public:
// * nNew // * nNew
// * nTried // * nTried
// * number of "new" buckets // * number of "new" buckets
// * all nNew addrinfo's in vvNew // * all nNew addrinfos in vvNew
// * all nTried addrinfo's in vvTried // * all nTried addrinfos in vvTried
// * for each bucket: // * for each bucket:
// * number of elements // * number of elements
// * for each element: index // * for each element: index

View File

@ -10,7 +10,7 @@
// could be used to create visually identical looking account numbers. // could be used to create visually identical looking account numbers.
// - A string with non-alphanumeric characters is not as easily accepted as an account number. // - A string with non-alphanumeric characters is not as easily accepted as an account number.
// - E-mail usually won't line-break if there's no punctuation to break at. // - E-mail usually won't line-break if there's no punctuation to break at.
// - Doubleclicking selects the whole number as one word if it's all alphanumeric. // - Double-clicking selects the whole number as one word if it's all alphanumeric.
// //
#ifndef BITCOIN_BASE58_H #ifndef BITCOIN_BASE58_H
#define BITCOIN_BASE58_H #define BITCOIN_BASE58_H

View File

@ -1881,7 +1881,7 @@ Value getwork(const Array& params, bool fHelp)
// Save // Save
mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0].vin[0].scriptSig); mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0].vin[0].scriptSig);
// Prebuild hash buffers // Pre-build hash buffers
char pmidstate[32]; char pmidstate[32];
char pdata[128]; char pdata[128];
char phash1[64]; char phash1[64];
@ -2194,7 +2194,7 @@ string rfc1123Time()
time(&now); time(&now);
struct tm* now_gmt = gmtime(&now); struct tm* now_gmt = gmtime(&now);
string locale(setlocale(LC_TIME, NULL)); string locale(setlocale(LC_TIME, NULL));
setlocale(LC_TIME, "C"); // we want posix (aka "C") weekday/month strings setlocale(LC_TIME, "C"); // we want POSIX (aka "C") weekday/month strings
strftime(buffer, sizeof(buffer), "%a, %d %b %Y %H:%M:%S +0000", now_gmt); strftime(buffer, sizeof(buffer), "%a, %d %b %Y %H:%M:%S +0000", now_gmt);
setlocale(LC_TIME, locale.c_str()); setlocale(LC_TIME, locale.c_str());
return string(buffer); return string(buffer);
@ -2388,7 +2388,7 @@ bool ClientAllowed(const boost::asio::ip::address& address)
if (address == asio::ip::address_v4::loopback() if (address == asio::ip::address_v4::loopback()
|| address == asio::ip::address_v6::loopback() || address == asio::ip::address_v6::loopback()
|| (address.is_v4() || (address.is_v4()
// Chech whether IPv4 addresses match 127.0.0.0/8 (loopback subnet) // Check whether IPv4 addresses match 127.0.0.0/8 (loopback subnet)
&& (address.to_v4().to_ulong() & 0xff000000) == 0x7f000000)) && (address.to_v4().to_ulong() & 0xff000000) == 0x7f000000))
return true; return true;
@ -2565,7 +2565,7 @@ static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol,
{ {
vnThreadsRunning[THREAD_RPCLISTENER]++; vnThreadsRunning[THREAD_RPCLISTENER]++;
// Immediately start accepting new connections, except when we're canceled or our socket is closed. // Immediately start accepting new connections, except when we're cancelled or our socket is closed.
if (error != asio::error::operation_aborted if (error != asio::error::operation_aborted
&& acceptor->is_open()) && acceptor->is_open())
RPCListen(acceptor, context, fUseSSL); RPCListen(acceptor, context, fUseSSL);
@ -2698,7 +2698,7 @@ void ThreadRPCServer2(void* parg)
} }
catch(boost::system::system_error &e) catch(boost::system::system_error &e)
{ {
uiInterface.ThreadSafeMessageBox(strprintf(_("An error occured while setting up the RPC port %i for listening: %s"), endpoint.port(), e.what()), uiInterface.ThreadSafeMessageBox(strprintf(_("An error occurred while setting up the RPC port %i for listening: %s"), endpoint.port(), e.what()),
_("Error"), CClientUIInterface::OK | CClientUIInterface::MODAL); _("Error"), CClientUIInterface::OK | CClientUIInterface::MODAL);
StartShutdown(); StartShutdown();
return; return;
@ -3105,7 +3105,7 @@ int CommandLineRPC(int argc, char *argv[])
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#ifdef _MSC_VER #ifdef _MSC_VER
// Turn off microsoft heap dump noise // Turn off Microsoft heap dump noise
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_WARN, CreateFile("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0)); _CrtSetReportFile(_CRT_WARN, CreateFile("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0));
#endif #endif

View File

@ -17,7 +17,7 @@ bool CCrypter::SetKeyFromPassphrase(const SecureString& strKeyData, const std::v
if (nRounds < 1 || chSalt.size() != WALLET_CRYPTO_SALT_SIZE) if (nRounds < 1 || chSalt.size() != WALLET_CRYPTO_SALT_SIZE)
return false; return false;
// Try to keep the keydata out of swap (and be a bit over-careful to keep the IV that we don't even use out of swap) // Try to keep the key data out of swap (and be a bit over-careful to keep the IV that we don't even use out of swap)
// Note that this does nothing about suspend-to-disk (which will put all our key data on disk) // Note that this does nothing about suspend-to-disk (which will put all our key data on disk)
// Note as well that at no point in this program is any attempt made to prevent stealing of keys by reading the memory of the running process. // Note as well that at no point in this program is any attempt made to prevent stealing of keys by reading the memory of the running process.
mlock(&chKey[0], sizeof chKey); mlock(&chKey[0], sizeof chKey);
@ -44,7 +44,7 @@ bool CCrypter::SetKey(const CKeyingMaterial& chNewKey, const std::vector<unsigne
if (chNewKey.size() != WALLET_CRYPTO_KEY_SIZE || chNewIV.size() != WALLET_CRYPTO_KEY_SIZE) if (chNewKey.size() != WALLET_CRYPTO_KEY_SIZE || chNewIV.size() != WALLET_CRYPTO_KEY_SIZE)
return false; return false;
// Try to keep the keydata out of swap // Try to keep the key data out of swap
// Note that this does nothing about suspend-to-disk (which will put all our key data on disk) // Note that this does nothing about suspend-to-disk (which will put all our key data on disk)
// Note as well that at no point in this program is any attempt made to prevent stealing of keys by reading the memory of the running process. // Note as well that at no point in this program is any attempt made to prevent stealing of keys by reading the memory of the running process.
mlock(&chKey[0], sizeof chKey); mlock(&chKey[0], sizeof chKey);

View File

@ -83,7 +83,7 @@ void Shutdown(void* parg)
printf("Bitcoin exited\n\n"); printf("Bitcoin exited\n\n");
fExit = true; fExit = true;
#ifndef QT_GUI #ifndef QT_GUI
// ensure non UI client get's exited here, but let Bitcoin-Qt reach return 0; in bitcoin.cpp // ensure non-UI client gets exited here, but let Bitcoin-Qt reach 'return 0;' in bitcoin.cpp
exit(0); exit(0);
#endif #endif
} }
@ -304,12 +304,12 @@ bool AppInit2()
{ {
// ********************************************************* Step 1: setup // ********************************************************* Step 1: setup
#ifdef _MSC_VER #ifdef _MSC_VER
// Turn off microsoft heap dump noise // Turn off Microsoft heap dump noise
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_WARN, CreateFileA("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0)); _CrtSetReportFile(_CRT_WARN, CreateFileA("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0));
#endif #endif
#if _MSC_VER >= 1400 #if _MSC_VER >= 1400
// Disable confusing "helpful" text message on abort, ctrl-c // Disable confusing "helpful" text message on abort, Ctrl-C
_set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
#endif #endif
#ifndef WIN32 #ifndef WIN32

View File

@ -207,7 +207,7 @@ void ThreadIRCSeed(void* parg)
void ThreadIRCSeed2(void* parg) void ThreadIRCSeed2(void* parg)
{ {
/* Dont advertise on IRC if we don't allow incoming connections */ /* Don't advertise on IRC if we don't allow incoming connections */
if (mapArgs.count("-connect") || fNoListen) if (mapArgs.count("-connect") || fNoListen)
return; return;

View File

@ -48,7 +48,7 @@ err:
// Perform ECDSA key recovery (see SEC1 4.1.6) for curves over (mod p)-fields // Perform ECDSA key recovery (see SEC1 4.1.6) for curves over (mod p)-fields
// recid selects which key is recovered // recid selects which key is recovered
// if check is nonzero, additional checks are performed // if check is non-zero, additional checks are performed
int ECDSA_SIG_recover_key_GFp(EC_KEY *eckey, ECDSA_SIG *ecsig, const unsigned char *msg, int msglen, int recid, int check) int ECDSA_SIG_recover_key_GFp(EC_KEY *eckey, ECDSA_SIG *ecsig, const unsigned char *msg, int msglen, int recid, int check)
{ {
if (!eckey) return 0; if (!eckey) return 0;

View File

@ -564,7 +564,7 @@ bool CTxMemPool::accept(CTxDB& txdb, CTransaction &tx, bool fCheckInputs,
// Continuously rate-limit free transactions // Continuously rate-limit free transactions
// This mitigates 'penny-flooding' -- sending thousands of free transactions just to // This mitigates 'penny-flooding' -- sending thousands of free transactions just to
// be annoying or make other's transactions take longer to confirm. // be annoying or make others' transactions take longer to confirm.
if (nFees < MIN_RELAY_TX_FEE) if (nFees < MIN_RELAY_TX_FEE)
{ {
static CCriticalSection cs; static CCriticalSection cs;
@ -1039,7 +1039,7 @@ bool CTransaction::DisconnectInputs(CTxDB& txdb)
// Remove transaction from index // Remove transaction from index
// This can fail if a duplicate of this transaction was in a chain that got // This can fail if a duplicate of this transaction was in a chain that got
// reorganized away. This is only possible if this transaction was completely // reorganized away. This is only possible if this transaction was completely
// spent, so erasing it would be a no-op anway. // spent, so erasing it would be a no-op anyway.
txdb.EraseTxIndex(*this); txdb.EraseTxIndex(*this);
return true; return true;
@ -1102,7 +1102,7 @@ bool CTransaction::FetchInputs(CTxDB& txdb, const map<uint256, CTxIndex>& mapTes
} }
} }
// Make sure all prevout.n's are valid: // Make sure all prevout.n indexes are valid:
for (unsigned int i = 0; i < vin.size(); i++) for (unsigned int i = 0; i < vin.size(); i++)
{ {
const COutPoint prevout = vin[i].prevout; const COutPoint prevout = vin[i].prevout;
@ -1338,7 +1338,7 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex, bool fJustCheck)
// being sent to another address. // being sent to another address.
// See BIP30 and http://r6.ca/blog/20120206T005236Z.html for more information. // See BIP30 and http://r6.ca/blog/20120206T005236Z.html for more information.
// This logic is not necessary for memory pool transactions, as AcceptToMemoryPool // This logic is not necessary for memory pool transactions, as AcceptToMemoryPool
// already refuses previously-known transaction id's entirely. // already refuses previously-known transaction ids entirely.
// This rule applies to all blocks whose timestamp is after March 15, 2012, 0:00 UTC. // This rule applies to all blocks whose timestamp is after March 15, 2012, 0:00 UTC.
int64 nBIP30SwitchTime = 1331769600; int64 nBIP30SwitchTime = 1331769600;
bool fEnforceBIP30 = (pindex->nTime > nBIP30SwitchTime); bool fEnforceBIP30 = (pindex->nTime > nBIP30SwitchTime);
@ -1604,7 +1604,7 @@ bool CBlock::SetBestChain(CTxDB& txdb, CBlockIndex* pindexNew)
return error("SetBestChain() : Reorganize failed"); return error("SetBestChain() : Reorganize failed");
} }
// Connect futher blocks // Connect further blocks
BOOST_REVERSE_FOREACH(CBlockIndex *pindex, vpindexSecondary) BOOST_REVERSE_FOREACH(CBlockIndex *pindex, vpindexSecondary)
{ {
CBlock block; CBlock block;
@ -1769,7 +1769,7 @@ bool CBlock::CheckBlock(bool fCheckPOW, bool fCheckMerkleRoot) const
if (nSigOps > MAX_BLOCK_SIGOPS) if (nSigOps > MAX_BLOCK_SIGOPS)
return DoS(100, error("CheckBlock() : out-of-bounds SigOpCount")); return DoS(100, error("CheckBlock() : out-of-bounds SigOpCount"));
// Check merkleroot // Check merkle root
if (fCheckMerkleRoot && hashMerkleRoot != BuildMerkleTree()) if (fCheckMerkleRoot && hashMerkleRoot != BuildMerkleTree())
return DoS(100, error("CheckBlock() : hashMerkleRoot mismatch")); return DoS(100, error("CheckBlock() : hashMerkleRoot mismatch"));
@ -1805,7 +1805,7 @@ bool CBlock::AcceptBlock()
// Check that the block chain matches the known block chain up to a checkpoint // Check that the block chain matches the known block chain up to a checkpoint
if (!Checkpoints::CheckBlock(nHeight, hash)) if (!Checkpoints::CheckBlock(nHeight, hash))
return DoS(100, error("AcceptBlock() : rejected by checkpoint lockin at %d", nHeight)); return DoS(100, error("AcceptBlock() : rejected by checkpoint lock-in at %d", nHeight));
// Write block to history file // Write block to history file
if (!CheckDiskSpace(::GetSerializeSize(*this, SER_DISK, CLIENT_VERSION))) if (!CheckDiskSpace(::GetSerializeSize(*this, SER_DISK, CLIENT_VERSION)))
@ -1963,7 +1963,7 @@ FILE* AppendBlockFile(unsigned int& nFileRet)
return NULL; return NULL;
if (fseek(file, 0, SEEK_END) != 0) if (fseek(file, 0, SEEK_END) != 0)
return NULL; return NULL;
// FAT32 filesize max 4GB, fseek and ftell max 2GB, so we must stay under 2GB // FAT32 file size max 4GB, fseek and ftell max 2GB, so we must stay under 2GB
if (ftell(file) < 0x7F000000 - MAX_SIZE) if (ftell(file) < 0x7F000000 - MAX_SIZE)
{ {
nFileRet = nCurrentBlockFile; nFileRet = nCurrentBlockFile;
@ -2055,7 +2055,7 @@ bool LoadBlockIndex(bool fAllowNew)
void PrintBlockTree() void PrintBlockTree()
{ {
// precompute tree structure // pre-compute tree structure
map<CBlockIndex*, vector<CBlockIndex*> > mapNext; map<CBlockIndex*, vector<CBlockIndex*> > mapNext;
for (map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi) for (map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi)
{ {
@ -2108,7 +2108,7 @@ void PrintBlockTree()
PrintWallets(block); PrintWallets(block);
// put the main timechain first // put the main time-chain first
vector<CBlockIndex*>& vNext = mapNext[pindex]; vector<CBlockIndex*>& vNext = mapNext[pindex];
for (unsigned int i = 0; i < vNext.size(); i++) for (unsigned int i = 0; i < vNext.size(); i++)
{ {
@ -2347,7 +2347,7 @@ bool static AlreadyHave(CTxDB& txdb, const CInv& inv)
// The message start string is designed to be unlikely to occur in normal data. // The message start string is designed to be unlikely to occur in normal data.
// The characters are rarely used upper ascii, not valid as UTF-8, and produce // The characters are rarely used upper ASCII, not valid as UTF-8, and produce
// a large 4-byte int at any alignment. // a large 4-byte int at any alignment.
unsigned char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 }; unsigned char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };
@ -3030,12 +3030,12 @@ bool ProcessMessages(CNode* pfrom)
{ {
if (strstr(e.what(), "end of data")) if (strstr(e.what(), "end of data"))
{ {
// Allow exceptions from underlength message on vRecv // Allow exceptions from under-length message on vRecv
printf("ProcessMessages(%s, %u bytes) : Exception '%s' caught, normally caused by a message being shorter than its stated length\n", strCommand.c_str(), nMessageSize, e.what()); printf("ProcessMessages(%s, %u bytes) : Exception '%s' caught, normally caused by a message being shorter than its stated length\n", strCommand.c_str(), nMessageSize, e.what());
} }
else if (strstr(e.what(), "size too large")) else if (strstr(e.what(), "size too large"))
{ {
// Allow exceptions from overlong size // Allow exceptions from over-long size
printf("ProcessMessages(%s, %u bytes) : Exception '%s' caught\n", strCommand.c_str(), nMessageSize, e.what()); printf("ProcessMessages(%s, %u bytes) : Exception '%s' caught\n", strCommand.c_str(), nMessageSize, e.what());
} }
else else
@ -3284,9 +3284,9 @@ unsigned int static ScanHash_CryptoPP(char* pmidstate, char* pdata, char* phash1
unsigned int& nNonce = *(unsigned int*)(pdata + 12); unsigned int& nNonce = *(unsigned int*)(pdata + 12);
for (;;) for (;;)
{ {
// Crypto++ SHA-256 // Crypto++ SHA256
// Hash pdata using pmidstate as the starting state into // Hash pdata using pmidstate as the starting state into
// preformatted buffer phash1, then hash phash1 into phash // pre-formatted buffer phash1, then hash phash1 into phash
nNonce++; nNonce++;
SHA256Transform(phash1, pdata, pmidstate); SHA256Transform(phash1, pdata, pmidstate);
SHA256Transform(phash, phash1, pSHA256InitState); SHA256Transform(phash, phash1, pSHA256InitState);
@ -3623,7 +3623,7 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int&
void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1) void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1)
{ {
// //
// Prebuild hash buffers // Pre-build hash buffers
// //
struct struct
{ {
@ -3751,7 +3751,7 @@ void static BitcoinMiner(CWallet *pwallet)
// //
// Prebuild hash buffers // Pre-build hash buffers
// //
char pmidstatebuf[32+16]; char* pmidstate = alignup<16>(pmidstatebuf); char pmidstatebuf[32+16]; char* pmidstate = alignup<16>(pmidstatebuf);
char pdatabuf[128+16]; char* pdata = alignup<16>(pdatabuf); char pdatabuf[128+16]; char* pdata = alignup<16>(pdatabuf);
@ -3776,7 +3776,7 @@ void static BitcoinMiner(CWallet *pwallet)
unsigned int nHashesDone = 0; unsigned int nHashesDone = 0;
unsigned int nNonceFound; unsigned int nNonceFound;
// Crypto++ SHA-256 // Crypto++ SHA256
nNonceFound = ScanHash_CryptoPP(pmidstate, pdata + 64, phash1, nNonceFound = ScanHash_CryptoPP(pmidstate, pdata + 64, phash1,
(char*)&hash, nHashesDone); (char*)&hash, nHashesDone);

View File

@ -552,7 +552,7 @@ public:
if (nBlockSize == 1) if (nBlockSize == 1)
{ {
// Transactions under 10K are free // Transactions under 10K are free
// (about 4500bc if made of 50bc inputs) // (about 4500 BTC if made of 50 BTC inputs)
if (nBytes < 10000) if (nBytes < 10000)
nMinFee = 0; nMinFee = 0;
} }

View File

@ -357,7 +357,7 @@ bool GetMyExternalIP(CNetAddr& ipRet)
{ {
// We should be phasing out our use of sites like these. If we need // We should be phasing out our use of sites like these. If we need
// replacements, we should ask for volunteers to put this simple // replacements, we should ask for volunteers to put this simple
// php file on their webserver that prints the client IP: // php file on their web server that prints the client IP:
// <?php echo $_SERVER["REMOTE_ADDR"]; ?> // <?php echo $_SERVER["REMOTE_ADDR"]; ?>
if (nHost == 1) if (nHost == 1)
{ {
@ -497,14 +497,14 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest, int64 nTimeout)
/// debug print /// debug print
printf("connected %s\n", pszDest ? pszDest : addrConnect.ToString().c_str()); printf("connected %s\n", pszDest ? pszDest : addrConnect.ToString().c_str());
// Set to nonblocking // Set to non-blocking
#ifdef WIN32 #ifdef WIN32
u_long nOne = 1; u_long nOne = 1;
if (ioctlsocket(hSocket, FIONBIO, &nOne) == SOCKET_ERROR) if (ioctlsocket(hSocket, FIONBIO, &nOne) == SOCKET_ERROR)
printf("ConnectSocket() : ioctlsocket nonblocking setting failed, error %d\n", WSAGetLastError()); printf("ConnectSocket() : ioctlsocket non-blocking setting failed, error %d\n", WSAGetLastError());
#else #else
if (fcntl(hSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR) if (fcntl(hSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR)
printf("ConnectSocket() : fcntl nonblocking setting failed, error %d\n", errno); printf("ConnectSocket() : fcntl non-blocking setting failed, error %d\n", errno);
#endif #endif
// Add node // Add node
@ -1596,7 +1596,7 @@ void ThreadOpenAddedConnections2(void* parg)
} }
} }
// if succesful, this moves the passed grant to the constructed node // if successful, this moves the passed grant to the constructed node
bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound, const char *strDest, bool fOneShot) bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound, const char *strDest, bool fOneShot)
{ {
// //
@ -1773,7 +1773,7 @@ bool BindListenPort(const CService &addrBind, string& strError)
#ifdef WIN32 #ifdef WIN32
// Set to nonblocking, incoming connections will also inherit this // Set to non-blocking, incoming connections will also inherit this
if (ioctlsocket(hListenSocket, FIONBIO, (u_long*)&nOne) == SOCKET_ERROR) if (ioctlsocket(hListenSocket, FIONBIO, (u_long*)&nOne) == SOCKET_ERROR)
#else #else
if (fcntl(hListenSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR) if (fcntl(hListenSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR)
@ -1834,7 +1834,7 @@ void static Discover()
return; return;
#ifdef WIN32 #ifdef WIN32
// Get local host ip // Get local host IP
char pszHostName[1000] = ""; char pszHostName[1000] = "";
if (gethostname(pszHostName, sizeof(pszHostName)) != SOCKET_ERROR) if (gethostname(pszHostName, sizeof(pszHostName)) != SOCKET_ERROR)
{ {

View File

@ -49,7 +49,7 @@ enum
LOCAL_BIND, // address explicit bound to LOCAL_BIND, // address explicit bound to
LOCAL_UPNP, // address reported by UPnP LOCAL_UPNP, // address reported by UPnP
LOCAL_IRC, // address reported by IRC (deprecated) LOCAL_IRC, // address reported by IRC (deprecated)
LOCAL_HTTP, // address reported by whatismyip.com and similars LOCAL_HTTP, // address reported by whatismyip.com and similar
LOCAL_MANUAL, // address explicitly specified (-externalip=) LOCAL_MANUAL, // address explicitly specified (-externalip=)
LOCAL_MAX LOCAL_MAX
@ -181,7 +181,7 @@ protected:
int nRefCount; int nRefCount;
// Denial-of-service detection/prevention // Denial-of-service detection/prevention
// Key is ip address, value is banned-until-time // Key is IP address, value is banned-until-time
static std::map<CNetAddr, int64> setBanned; static std::map<CNetAddr, int64> setBanned;
static CCriticalSection cs_setBanned; static CCriticalSection cs_setBanned;
int nMisbehavior; int nMisbehavior;

View File

@ -702,7 +702,7 @@ bool CNetAddr::IsMulticast() const
bool CNetAddr::IsValid() const bool CNetAddr::IsValid() const
{ {
// Clean up 3-byte shifted addresses caused by garbage in size field // Cleanup 3-byte shifted addresses caused by garbage in size field
// of addr messages from versions before 0.2.9 checksum. // of addr messages from versions before 0.2.9 checksum.
// Two consecutive addr messages look like this: // Two consecutive addr messages look like this:
// header20 vectorlen3 addr26 addr26 addr26 header20 vectorlen3 addr26 addr26 addr26... // header20 vectorlen3 addr26 addr26 addr26 header20 vectorlen3 addr26 addr26 addr26...
@ -851,13 +851,13 @@ std::vector<unsigned char> CNetAddr::GetGroup() const
nClass = NET_IPV4; nClass = NET_IPV4;
nStartByte = 12; nStartByte = 12;
} }
// for 6to4 tunneled addresses, use the encapsulated IPv4 address // for 6to4 tunnelled addresses, use the encapsulated IPv4 address
else if (IsRFC3964()) else if (IsRFC3964())
{ {
nClass = NET_IPV4; nClass = NET_IPV4;
nStartByte = 2; nStartByte = 2;
} }
// for Teredo-tunneled IPv6 addresses, use the encapsulated IPv4 address // for Teredo-tunnelled IPv6 addresses, use the encapsulated IPv4 address
else if (IsRFC4380()) else if (IsRFC4380())
{ {
vchRet.push_back(NET_IPV4); vchRet.push_back(NET_IPV4);
@ -954,7 +954,7 @@ int CNetAddr::GetReachabilityFrom(const CNetAddr *paddrPartner) const
default: return REACH_DEFAULT; default: return REACH_DEFAULT;
case NET_TEREDO: return REACH_TEREDO; case NET_TEREDO: return REACH_TEREDO;
case NET_IPV4: return REACH_IPV4; case NET_IPV4: return REACH_IPV4;
case NET_IPV6: return fTunnel ? REACH_IPV6_WEAK : REACH_IPV6_STRONG; // only prefer giving our IPv6 address if it's not tunneled case NET_IPV6: return fTunnel ? REACH_IPV6_WEAK : REACH_IPV6_STRONG; // only prefer giving our IPv6 address if it's not tunnelled
} }
case NET_TOR: case NET_TOR:
switch(ourNet) { switch(ourNet) {

View File

@ -50,9 +50,9 @@ class CNetAddr
bool IsRFC1918() const; // IPv4 private networks (10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12) bool IsRFC1918() const; // IPv4 private networks (10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12)
bool IsRFC3849() const; // IPv6 documentation address (2001:0DB8::/32) bool IsRFC3849() const; // IPv6 documentation address (2001:0DB8::/32)
bool IsRFC3927() const; // IPv4 autoconfig (169.254.0.0/16) bool IsRFC3927() const; // IPv4 autoconfig (169.254.0.0/16)
bool IsRFC3964() const; // IPv6 6to4 tunneling (2002::/16) bool IsRFC3964() const; // IPv6 6to4 tunnelling (2002::/16)
bool IsRFC4193() const; // IPv6 unique local (FC00::/15) bool IsRFC4193() const; // IPv6 unique local (FC00::/15)
bool IsRFC4380() const; // IPv6 Teredo tunneling (2001::/32) bool IsRFC4380() const; // IPv6 Teredo tunnelling (2001::/32)
bool IsRFC4843() const; // IPv6 ORCHID (2001:10::/28) bool IsRFC4843() const; // IPv6 ORCHID (2001:10::/28)
bool IsRFC4862() const; // IPv6 autoconfig (FE80::/64) bool IsRFC4862() const; // IPv6 autoconfig (FE80::/64)
bool IsRFC6052() const; // IPv6 well-known prefix (64:FF9B::/96) bool IsRFC6052() const; // IPv6 well-known prefix (64:FF9B::/96)

View File

@ -177,7 +177,7 @@ void AskPassphraseDialog::accept()
void AskPassphraseDialog::textChanged() void AskPassphraseDialog::textChanged()
{ {
// Validate input, set Ok button to enabled when accepable // Validate input, set Ok button to enabled when acceptable
bool acceptable = false; bool acceptable = false;
switch(mode) switch(mode)
{ {

View File

@ -272,7 +272,7 @@ int main(int argc, char *argv[])
// TODO: implement URI support on the Mac. // TODO: implement URI support on the Mac.
#if !defined(MAC_OSX) #if !defined(MAC_OSX)
// Place this here as guiref has to be defined if we dont want to lose URIs // Place this here as guiref has to be defined if we don't want to lose URIs
ipcInit(); ipcInit();
// Check for URI in argv // Check for URI in argv
@ -299,7 +299,7 @@ int main(int argc, char *argv[])
window.setWalletModel(0); window.setWalletModel(0);
guiref = 0; guiref = 0;
} }
// Shutdown the core and it's threads, but don't exit Bitcoin-Qt here // Shutdown the core and its threads, but don't exit Bitcoin-Qt here
Shutdown(NULL); Shutdown(NULL);
} }
else else

View File

@ -5,8 +5,8 @@
This is: This is:
- All numbers except for '0' - All numbers except for '0'
- All uppercase letters except for 'I' and 'O' - All upper-case letters except for 'I' and 'O'
- All lowercase letters except for 'l' - All lower-case letters except for 'l'
User friendly Base58 input can map User friendly Base58 input can map
- 'l' and 'I' to '1' - 'l' and 'I' to '1'

View File

@ -40,7 +40,7 @@ signals:
void textChanged(); void textChanged();
protected: protected:
/** Intercept focus-in event and ',' keypresses */ /** Intercept focus-in event and ',' key presses */
bool eventFilter(QObject *object, QEvent *event); bool eventFilter(QObject *object, QEvent *event);
private: private:

View File

@ -158,7 +158,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));
// Doubleclicking on a transaction on the transaction history page shows details // Double-clicking on a transaction on the transaction history page shows details
connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
rpcConsole = new RPCConsole(this); rpcConsole = new RPCConsole(this);
@ -400,7 +400,7 @@ void BitcoinGUI::setWalletModel(WalletModel *walletModel)
setEncryptionStatus(walletModel->getEncryptionStatus()); setEncryptionStatus(walletModel->getEncryptionStatus());
connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SLOT(setEncryptionStatus(int))); connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SLOT(setEncryptionStatus(int)));
// Balloon popup for new transaction // Balloon pop-up for new transaction
connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(incomingTransaction(QModelIndex,int,int))); this, SLOT(incomingTransaction(QModelIndex,int,int)));
@ -492,7 +492,7 @@ void BitcoinGUI::setNumConnections(int count)
void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
{ {
// don't show / hide progressBar and it's label if we have no connection(s) to the network // don't show / hide progressBar and its label if we have no connection(s) to the network
if (!clientModel || clientModel->getNumConnections() == 0) if (!clientModel || clientModel->getNumConnections() == 0)
{ {
progressBarLabel->setVisible(false); progressBarLabel->setVisible(false);

View File

@ -101,7 +101,7 @@ private:
/** Create the main UI actions. */ /** Create the main UI actions. */
void createActions(); void createActions();
/** Create the menu bar and submenus. */ /** Create the menu bar and sub-menus. */
void createMenuBar(); void createMenuBar();
/** Create the toolbars */ /** Create the toolbars */
void createToolBars(); void createToolBars();
@ -168,7 +168,7 @@ private slots:
void backupWallet(); void backupWallet();
/** Change encrypted wallet passphrase */ /** Change encrypted wallet passphrase */
void changePassphrase(); void changePassphrase();
/** Ask for pass phrase to unlock wallet temporarily */ /** Ask for passphrase to unlock wallet temporarily */
void unlockWallet(); void unlockWallet();
/** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */ /** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */

View File

@ -99,7 +99,7 @@ QString BitcoinUnits::format(int unit, qint64 n, bool fPlus)
QString quotient_str = QString::number(quotient); QString quotient_str = QString::number(quotient);
QString remainder_str = QString::number(remainder).rightJustified(num_decimals, '0'); QString remainder_str = QString::number(remainder).rightJustified(num_decimals, '0');
// Right-trim excess 0's after the decimal point // Right-trim excess zeros after the decimal point
int nTrim = 0; int nTrim = 0;
for (int i = remainder_str.size()-1; i>=2 && (remainder_str.at(i) == '0'); --i) for (int i = remainder_str.size()-1; i>=2 && (remainder_str.at(i) == '0'); --i)
++nTrim; ++nTrim;

View File

@ -5,7 +5,7 @@
#include <QAbstractListModel> #include <QAbstractListModel>
/** Bitcoin unit definitions. Encapsulates parsing and formatting /** Bitcoin unit definitions. Encapsulates parsing and formatting
and serves as list model for dropdown selection boxes. and serves as list model for drop-down selection boxes.
*/ */
class BitcoinUnits: public QAbstractListModel class BitcoinUnits: public QAbstractListModel
{ {
@ -26,7 +26,7 @@ public:
//! Unit conversion and formatting //! Unit conversion and formatting
///@{ ///@{
//! Get list of units, for dropdown box //! Get list of units, for drop-down box
static QList<Unit> availableUnits(); static QList<Unit> availableUnits();
//! Is unit ID valid? //! Is unit ID valid?
static bool valid(int unit); static bool valid(int unit);
@ -49,7 +49,7 @@ public:
///@} ///@}
//! @name AbstractListModel implementation //! @name AbstractListModel implementation
//! List model for unit dropdown selection box. //! List model for unit drop-down selection box.
///@{ ///@{
enum RoleIndex { enum RoleIndex {
/** Unit identifier */ /** Unit identifier */

View File

@ -131,7 +131,7 @@ bool parseBitcoinURI(QString uri, SendCoinsRecipient *out)
// Convert bitcoin:// to bitcoin: // Convert bitcoin:// to bitcoin:
// //
// Cannot handle this later, because bitcoin:// will cause Qt to see the part after // as host, // Cannot handle this later, because bitcoin:// will cause Qt to see the part after // as host,
// which will lowercase it (and thus invalidate the address). // which will lower-case it (and thus invalidate the address).
if(uri.startsWith("bitcoin://")) if(uri.startsWith("bitcoin://"))
{ {
uri.replace(0, 10, "bitcoin:"); uri.replace(0, 10, "bitcoin:");
@ -436,7 +436,7 @@ HelpMessageBox::HelpMessageBox(QWidget *parent) :
setWindowTitle(tr("Bitcoin-Qt")); setWindowTitle(tr("Bitcoin-Qt"));
setTextFormat(Qt::PlainText); setTextFormat(Qt::PlainText);
// setMinimumWidth is ignored for QMessageBox so put in nonbreaking spaces to make it wider. // setMinimumWidth is ignored for QMessageBox so put in non-breaking spaces to make it wider.
setText(header + QString(QChar(0x2003)).repeated(50)); setText(header + QString(QChar(0x2003)).repeated(50));
setDetailedText(coreOptions + "\n" + uiOptions); setDetailedText(coreOptions + "\n" + uiOptions);
} }

View File

@ -47,7 +47,7 @@ namespace GUIUtil
*/ */
void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole); void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole);
/** Get save file name, mimics QFileDialog::getSaveFileName, except that it appends a default suffix /** Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix
when no suffix is provided by the user. when no suffix is provided by the user.
@param[in] parent Parent window (or 0) @param[in] parent Parent window (or 0)

View File

@ -82,7 +82,7 @@ public:
static int metaType(); static int metaType();
// Image to variant that can be marshaled over DBus // Image to variant that can be marshalled over DBus
static QVariant toVariant(const QImage &img); static QVariant toVariant(const QImage &img);
private: private:
@ -294,7 +294,7 @@ void Notificator::notify(Class cls, const QString &title, const QString &text, c
default: default:
if(cls == Critical) if(cls == Critical)
{ {
// Fall back to old fashioned popup dialog if critical and no other notification available // Fall back to old fashioned pop-up dialog if critical and no other notification available
QMessageBox::critical(parent, title, text, QMessageBox::Ok, QMessageBox::Ok); QMessageBox::critical(parent, title, text, QMessageBox::Ok, QMessageBox::Ok);
} }
break; break;

View File

@ -27,7 +27,7 @@ public:
{ {
Information, /**< Informational message */ Information, /**< Informational message */
Warning, /**< Notify user of potential problem */ Warning, /**< Notify user of potential problem */
Critical /**< An error occured */ Critical /**< An error occurred */
}; };
public slots: public slots:

View File

@ -126,7 +126,7 @@ void SignVerifyMessageDialog::on_signMessageButton_SM_clicked()
if (!ctx.isValid()) if (!ctx.isValid())
{ {
ui->statusLabel_SM->setStyleSheet("QLabel { color: red; }"); ui->statusLabel_SM->setStyleSheet("QLabel { color: red; }");
ui->statusLabel_SM->setText(tr("Wallet unlock was canceled.")); ui->statusLabel_SM->setText(tr("Wallet unlock was cancelled."));
return; return;
} }

View File

@ -23,7 +23,7 @@ public:
void setDateRange(const QDateTime &from, const QDateTime &to); void setDateRange(const QDateTime &from, const QDateTime &to);
void setAddressPrefix(const QString &addrPrefix); void setAddressPrefix(const QString &addrPrefix);
/** /**
@note Type filter takes a bitfield created with TYPE() or ALL_TYPES @note Type filter takes a bit field created with TYPE() or ALL_TYPES
*/ */
void setTypeFilter(quint32 modes); void setTypeFilter(quint32 modes);
void setMinAmount(qint64 minimum); void setMinAmount(qint64 minimum);

View File

@ -205,7 +205,7 @@ void TransactionView::chooseDate(int idx)
TransactionFilterProxy::MAX_DATE); TransactionFilterProxy::MAX_DATE);
break; break;
case ThisWeek: { case ThisWeek: {
// Find last monday // Find last Monday
QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1)); QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1));
transactionProxyModel->setDateRange( transactionProxyModel->setDateRange(
QDateTime(startOfWeek), QDateTime(startOfWeek),

View File

@ -1070,7 +1070,7 @@ uint256 SignatureHash(CScript scriptCode, const CTransaction& txTo, unsigned int
} }
else if ((nHashType & 0x1f) == SIGHASH_SINGLE) else if ((nHashType & 0x1f) == SIGHASH_SINGLE)
{ {
// Only lockin the txout payee at same index as txin // Only lock-in the txout payee at same index as txin
unsigned int nOut = nIn; unsigned int nOut = nIn;
if (nOut >= txTmp.vout.size()) if (nOut >= txTmp.vout.size())
{ {
@ -1272,7 +1272,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
if (!script2.GetOp(pc2, opcode2, vch2)) if (!script2.GetOp(pc2, opcode2, vch2))
break; break;
// Normal situation is to fall through // Normal situation is to fall through
// to other if/else statments // to other if/else statements
} }
if (opcode2 == OP_PUBKEY) if (opcode2 == OP_PUBKEY)
@ -1345,7 +1345,7 @@ bool SignN(const vector<valtype>& multisigdata, const CKeyStore& keystore, uint2
// Sign scriptPubKey with private keys stored in keystore, given transaction hash and hash type. // Sign scriptPubKey with private keys stored in keystore, given transaction hash and hash type.
// Signatures are returned in scriptSigRet (or returns false if scriptPubKey can't be signed), // Signatures are returned in scriptSigRet (or returns false if scriptPubKey can't be signed),
// unless whichTypeRet is TX_SCRIPTHASH, in which case scriptSigRet is the redemption script. // unless whichTypeRet is TX_SCRIPTHASH, in which case scriptSigRet is the redemption script.
// Returns false if scriptPubKey could not be completely satisified. // Returns false if scriptPubKey could not be completely satisfied.
// //
bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash, int nHashType, bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash, int nHashType,
CScript& scriptSigRet, txnouttype& whichTypeRet) CScript& scriptSigRet, txnouttype& whichTypeRet)
@ -1733,7 +1733,7 @@ static CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo,
return PushAll(sigs1); return PushAll(sigs1);
else else
{ {
// Recurse to combine: // Recur to combine:
valtype spk = sigs1.back(); valtype spk = sigs1.back();
CScript pubKey2(spk.begin(), spk.end()); CScript pubKey2(spk.begin(), spk.end());
@ -1811,7 +1811,7 @@ unsigned int CScript::GetSigOpCount(const CScript& scriptSig) const
return 0; return 0;
} }
/// ... and return it's opcount: /// ... and return its opcount:
CScript subscript(data.begin(), data.end()); CScript subscript(data.begin(), data.end());
return subscript.GetSigOpCount(true); return subscript.GetSigOpCount(true);
} }

View File

@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE(DoS_banning)
CNode dummyNode1(INVALID_SOCKET, addr1, "", true); CNode dummyNode1(INVALID_SOCKET, addr1, "", true);
dummyNode1.Misbehaving(100); // Should get banned dummyNode1.Misbehaving(100); // Should get banned
BOOST_CHECK(CNode::IsBanned(addr1)); BOOST_CHECK(CNode::IsBanned(addr1));
BOOST_CHECK(!CNode::IsBanned(ip(0xa0b0c001|0x0000ff00))); // Different ip, not banned BOOST_CHECK(!CNode::IsBanned(ip(0xa0b0c001|0x0000ff00))); // Different IP, not banned
CAddress addr2(ip(0xa0b0c002)); CAddress addr2(ip(0xa0b0c002));
CNode dummyNode2(INVALID_SOCKET, addr2, "", true); CNode dummyNode2(INVALID_SOCKET, addr2, "", true);

View File

@ -130,7 +130,7 @@ BOOST_AUTO_TEST_CASE(norecurse)
// Should not verify, because it will try to execute OP_INVALIDOPCODE // Should not verify, because it will try to execute OP_INVALIDOPCODE
BOOST_CHECK(!Verify(scriptSig, p2sh, true)); BOOST_CHECK(!Verify(scriptSig, p2sh, true));
// Try to recurse, and verification should succeed because // Try to recur, and verification should succeed because
// the inner HASH160 <> EQUAL should only check the hash: // the inner HASH160 <> EQUAL should only check the hash:
CScript p2sh2; CScript p2sh2;
p2sh2.SetDestination(p2sh.GetID()); p2sh2.SetDestination(p2sh.GetID());
@ -225,7 +225,7 @@ BOOST_AUTO_TEST_CASE(is)
BOOST_AUTO_TEST_CASE(switchover) BOOST_AUTO_TEST_CASE(switchover)
{ {
// Test switchover code // Test switch over code
CScript notValid; CScript notValid;
notValid << OP_11 << OP_12 << OP_EQUALVERIFY; notValid << OP_11 << OP_12 << OP_EQUALVERIFY;
CScript scriptSig; CScript scriptSig;

View File

@ -164,11 +164,11 @@ BOOST_AUTO_TEST_CASE(coin_selection_tests)
add_coin( 3*COIN); add_coin( 3*COIN);
add_coin( 4*COIN); // now we have 5+6+7+8+18+20+30+100+200+300+400 = 1094 cents add_coin( 4*COIN); // now we have 5+6+7+8+18+20+30+100+200+300+400 = 1094 cents
BOOST_CHECK( wallet.SelectCoinsMinConf(95 * CENT, 1, 1, vCoins, setCoinsRet, nValueRet)); BOOST_CHECK( wallet.SelectCoinsMinConf(95 * CENT, 1, 1, vCoins, setCoinsRet, nValueRet));
BOOST_CHECK_EQUAL(nValueRet, 1 * COIN); // we should get 1 bitcoin in 1 coin BOOST_CHECK_EQUAL(nValueRet, 1 * COIN); // we should get 1 BTC in 1 coin
BOOST_CHECK_EQUAL(setCoinsRet.size(), 1); BOOST_CHECK_EQUAL(setCoinsRet.size(), 1);
BOOST_CHECK( wallet.SelectCoinsMinConf(195 * CENT, 1, 1, vCoins, setCoinsRet, nValueRet)); BOOST_CHECK( wallet.SelectCoinsMinConf(195 * CENT, 1, 1, vCoins, setCoinsRet, nValueRet));
BOOST_CHECK_EQUAL(nValueRet, 2 * COIN); // we should get 2 bitcoins in 1 coin BOOST_CHECK_EQUAL(nValueRet, 2 * COIN); // we should get 2 BTC in 1 coin
BOOST_CHECK_EQUAL(setCoinsRet.size(), 1); BOOST_CHECK_EQUAL(setCoinsRet.size(), 1);
// empty the wallet and start again, now with fractions of a cent, to test sub-cent change avoidance // empty the wallet and start again, now with fractions of a cent, to test sub-cent change avoidance

View File

@ -348,7 +348,7 @@ string FormatMoney(int64 n, bool fPlus)
int64 remainder = n_abs%COIN; int64 remainder = n_abs%COIN;
string str = strprintf("%"PRI64d".%08"PRI64d, quotient, remainder); string str = strprintf("%"PRI64d".%08"PRI64d, quotient, remainder);
// Right-trim excess 0's before the decimal point: // Right-trim excess zeros before the decimal point:
int nTrim = 0; int nTrim = 0;
for (int i = str.size()-1; (str[i] == '0' && isdigit(str[i-2])); --i) for (int i = str.size()-1; (str[i] == '0' && isdigit(str[i-2])); --i)
++nTrim; ++nTrim;

View File

@ -12,7 +12,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#else #else
typedef int pid_t; /* define for windows compatiblity */ typedef int pid_t; /* define for windows compatibility */
#endif #endif
#include <map> #include <map>
#include <vector> #include <vector>

View File

@ -10,7 +10,7 @@
// client versioning // client versioning
// //
// These need to be macro's, as version.cpp's voodoo requires it // These need to be macros, as version.cpp's voodoo requires it
#define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 6 #define CLIENT_VERSION_MINOR 6
#define CLIENT_VERSION_REVISION 99 #define CLIENT_VERSION_REVISION 99

View File

@ -758,7 +758,7 @@ void CWallet::ReacceptWalletTransactions()
} }
else else
{ {
// Reaccept any txes of ours that aren't already in a block // Re-accept any txes of ours that aren't already in a block
if (!wtx.IsCoinBase()) if (!wtx.IsCoinBase())
wtx.AcceptWalletTransaction(txdb, false); wtx.AcceptWalletTransaction(txdb, false);
} }
@ -767,7 +767,7 @@ void CWallet::ReacceptWalletTransactions()
{ {
// TODO: optimize this to scan just part of the block chain? // TODO: optimize this to scan just part of the block chain?
if (ScanForWalletTransactions(pindexGenesisBlock)) if (ScanForWalletTransactions(pindexGenesisBlock))
fRepeat = true; // Found missing transactions: re-do Reaccept. fRepeat = true; // Found missing transactions: re-do re-accept.
} }
} }
} }