Browse Source

Merge pull request #2456 from Diapolo/code-layout

small indentation, space, formatting fixes (no code changes)
0.8
Pieter Wuille 12 years ago
parent
commit
484af4e2d1
  1. 3
      src/init.cpp
  2. 6
      src/net.cpp
  3. 1
      src/qt/bitcoingui.h
  4. 1
      src/qt/paymentserver.h
  5. 18
      src/util.cpp
  6. 6
      src/util.h

3
src/init.cpp

@ -376,7 +376,6 @@ struct CImportingNow
} }
}; };
void ThreadImport(std::vector<boost::filesystem::path> vImportFiles) void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
{ {
RenameThread("bitcoin-loadblk"); RenameThread("bitcoin-loadblk");
@ -633,7 +632,6 @@ bool AppInit2(boost::thread_group& threadGroup)
// ********************************************************* Step 6: network initialization // ********************************************************* Step 6: network initialization
int nSocksVersion = GetArg("-socks", 5); int nSocksVersion = GetArg("-socks", 5);
if (nSocksVersion != 4 && nSocksVersion != 5) if (nSocksVersion != 4 && nSocksVersion != 5)
return InitError(strprintf(_("Unknown -socks proxy version requested: %i"), nSocksVersion)); return InitError(strprintf(_("Unknown -socks proxy version requested: %i"), nSocksVersion));
@ -733,6 +731,7 @@ bool AppInit2(boost::thread_group& threadGroup)
fReindex = GetBoolArg("-reindex"); fReindex = GetBoolArg("-reindex");
// Todo: Check if needed, because in step 5 we do the same
if (!bitdb.Open(GetDataDir())) if (!bitdb.Open(GetDataDir()))
{ {
string msg = strprintf(_("Error initializing database environment %s!" string msg = strprintf(_("Error initializing database environment %s!"

6
src/net.cpp

@ -350,7 +350,7 @@ bool GetMyExternalIP(CNetAddr& ipRet)
// <?php echo $_SERVER["REMOTE_ADDR"]; ?> // <?php echo $_SERVER["REMOTE_ADDR"]; ?>
if (nHost == 1) if (nHost == 1)
{ {
addrConnect = CService("91.198.22.70",80); // checkip.dyndns.org addrConnect = CService("91.198.22.70", 80); // checkip.dyndns.org
if (nLookup == 1) if (nLookup == 1)
{ {
@ -424,12 +424,10 @@ void AddressCurrentlyConnected(const CService& addr)
CNode* FindNode(const CNetAddr& ip) CNode* FindNode(const CNetAddr& ip)
{ {
{
LOCK(cs_vNodes); LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes) BOOST_FOREACH(CNode* pnode, vNodes)
if ((CNetAddr)pnode->addr == ip) if ((CNetAddr)pnode->addr == ip)
return (pnode); return (pnode);
}
return NULL; return NULL;
} }
@ -444,12 +442,10 @@ CNode* FindNode(std::string addrName)
CNode* FindNode(const CService& addr) CNode* FindNode(const CService& addr)
{ {
{
LOCK(cs_vNodes); LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes) BOOST_FOREACH(CNode* pnode, vNodes)
if ((CService)pnode->addr == addr) if ((CService)pnode->addr == addr)
return (pnode); return (pnode);
}
return NULL; return NULL;
} }

1
src/qt/bitcoingui.h

@ -61,6 +61,7 @@ public:
void removeAllWallets(); void removeAllWallets();
/** Used by WalletView to allow access to needed QActions */ /** Used by WalletView to allow access to needed QActions */
// Todo: Use Qt signals for these
QAction * getOverviewAction() { return overviewAction; } QAction * getOverviewAction() { return overviewAction; }
QAction * getHistoryAction() { return historyAction; } QAction * getHistoryAction() { return historyAction; }
QAction * getAddressBookAction() { return addressBookAction; } QAction * getAddressBookAction() { return addressBookAction; }

1
src/qt/paymentserver.h

@ -37,6 +37,7 @@ class QLocalServer;
class PaymentServer : public QObject class PaymentServer : public QObject
{ {
Q_OBJECT Q_OBJECT
private: private:
bool saveURIs; bool saveURIs;
QLocalServer* uriServer; QLocalServer* uriServer;

18
src/util.cpp

@ -1072,7 +1072,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific)
fs::create_directory(path); fs::create_directory(path);
cachedPath[fNetSpecific]=true; cachedPath[fNetSpecific] = true;
return path; return path;
} }
@ -1336,14 +1336,14 @@ void seed_insecure_rand(bool fDeterministic)
insecure_rand_Rz = insecure_rand_Rw = 11; insecure_rand_Rz = insecure_rand_Rw = 11;
} else { } else {
uint32_t tmp; uint32_t tmp;
do{ do {
RAND_bytes((unsigned char*)&tmp,4); RAND_bytes((unsigned char*)&tmp, 4);
}while(tmp==0 || tmp==0x9068ffffU); } while(tmp == 0 || tmp == 0x9068ffffU);
insecure_rand_Rz=tmp; insecure_rand_Rz = tmp;
do{ do {
RAND_bytes((unsigned char*)&tmp,4); RAND_bytes((unsigned char*)&tmp, 4);
}while(tmp==0 || tmp==0x464fffffU); } while(tmp == 0 || tmp == 0x464fffffU);
insecure_rand_Rw=tmp; insecure_rand_Rw = tmp;
} }
} }

6
src/util.h

@ -419,9 +419,9 @@ extern uint32_t insecure_rand_Rz;
extern uint32_t insecure_rand_Rw; extern uint32_t insecure_rand_Rw;
static inline uint32_t insecure_rand(void) static inline uint32_t insecure_rand(void)
{ {
insecure_rand_Rz=36969*(insecure_rand_Rz&65535)+(insecure_rand_Rz>>16); insecure_rand_Rz = 36969 * (insecure_rand_Rz & 65535) + (insecure_rand_Rz >> 16);
insecure_rand_Rw=18000*(insecure_rand_Rw&65535)+(insecure_rand_Rw>>16); insecure_rand_Rw = 18000 * (insecure_rand_Rw & 65535) + (insecure_rand_Rw >> 16);
return (insecure_rand_Rw<<16)+insecure_rand_Rz; return (insecure_rand_Rw << 16) + insecure_rand_Rz;
} }
/** /**

Loading…
Cancel
Save