Permalink
Browse files

Code Cleanup

  • Loading branch information...
Tranz5 committed Aug 15, 2014
1 parent 077575f commit 4bbc2bea564709d95ad3883ee4ad3473b333acee
Showing with 2 additions and 43 deletions.
  1. +0 −9 src/bitcoinrpc.cpp
  2. +0 −1 src/bitcoinrpc.h
  3. +0 −5 src/net.cpp
  4. +0 −1 src/net.h
  5. +1 −1 src/rpcblockchain.cpp
  6. +1 −1 src/rpcmining.cpp
  7. +0 −4 src/script.cpp
  8. +0 −10 src/script.h
  9. +0 −11 src/util.h
View
@@ -110,15 +110,6 @@ Value ValueFromAmount(int64 amount)
return (double)amount / (double)COIN;
}
std::string HexBits(unsigned int nBits)
{
union {
int32_t nBits;
char cBits[4];
} uBits;
uBits.nBits = htonl((int32_t)nBits);
return HexStr(BEGIN(uBits.cBits), END(uBits.cBits));
}
View
@@ -132,7 +132,6 @@ extern json_spirit::Value ValueFromAmount(int64 amount);
extern double GetDifficulty(const CBlockIndex* blockindex = NULL);
extern double GetPoWMHashPS();
extern double GetPoSKernelPS();
extern std::string HexBits(unsigned int nBits);
extern std::string HelpRequiringPassphrase(CWallet* pWallet = NULL);
extern void EnsureWalletIsUnlocked(CWallet* pWallet = NULL);
View
@@ -543,10 +543,6 @@ void CNode::CloseSocketDisconnect()
}
void CNode::Cleanup()
{
}
void CNode::PushVersion()
{
@@ -804,7 +800,6 @@ void ThreadSocketHandler2(void* parg)
// close socket and cleanup
pnode->CloseSocketDisconnect();
pnode->Cleanup();
// hold in disconnected pool until all refs are released
if (pnode->fNetworkNode || pnode->fInbound)
View
@@ -679,7 +679,6 @@ class CNode
void Subscribe(unsigned int nChannel, unsigned int nHops=0);
void CancelSubscribe(unsigned int nChannel);
void CloseSocketDisconnect();
void Cleanup();
// Denial-of-service detection/prevention
View
@@ -107,7 +107,7 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool fPri
result.push_back(Pair("mint", ValueFromAmount(blockindex->nMint)));
result.push_back(Pair("time", (boost::int64_t)block.GetBlockTime()));
result.push_back(Pair("nonce", (boost::uint64_t)block.nNonce));
result.push_back(Pair("bits", HexBits(block.nBits)));
result.push_back(Pair("bits", strprintf("%08x", block.nBits)));
result.push_back(Pair("difficulty", GetDifficulty(blockindex)));
result.push_back(Pair("blocktrust", leftTrim(blockindex->GetBlockTrust().GetHex(), '0')));
if (blockindex->pprev)
View
@@ -508,7 +508,7 @@ Value getblocktemplate(CWallet* pWallet, const Array& params, bool fHelp)
result.push_back(Pair("sigoplimit", (int64_t)MAX_BLOCK_SIGOPS));
result.push_back(Pair("sizelimit", (int64_t)MAX_BLOCK_SIZE));
result.push_back(Pair("curtime", (int64_t)pblock->nTime));
result.push_back(Pair("bits", HexBits(pblock->nBits)));
result.push_back(Pair("bits", strprintf("%08x", pblock->nBits)));
result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1)));
return result;
View
@@ -935,10 +935,6 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
valtype& vchSig = stacktop(-2);
valtype& vchPubKey = stacktop(-1);
////// debug print
// PrintHex(vchSig.begin(), vchSig.end(), "sig: %s\n");
// PrintHex(vchPubKey.begin(), vchPubKey.end(), "pubkey: %s\n");
// Subset of script starting at the most recent codeseparator
CScript scriptCode(pbegincodehash, pend);
View
@@ -548,11 +548,6 @@ class CScript : public std::vector<unsigned char>
void SetMultisig(int nRequired, const std::vector<CKey>& keys);
void PrintHex() const
{
printf("CScript(%s)\n", HexStr(begin(), end(), true).c_str());
}
std::string ToString(bool fShort=false) const
{
std::string str;
@@ -576,11 +571,6 @@ class CScript : public std::vector<unsigned char>
return str;
}
void print() const
{
printf("%s\n", ToString().c_str());
}
CScriptID GetID() const
{
return CScriptID(Hash160(*this));
View
@@ -337,17 +337,6 @@ inline std::string HexStr(const std::vector<unsigned char>& vch, bool fSpaces=fa
return HexStr(vch.begin(), vch.end(), fSpaces);
}
template<typename T>
void PrintHex(const T pbegin, const T pend, const char* pszFormat="%s", bool fSpaces=true)
{
printf(pszFormat, HexStr(pbegin, pend, fSpaces).c_str());
}
inline void PrintHex(const std::vector<unsigned char>& vch, const char* pszFormat="%s", bool fSpaces=true)
{
printf(pszFormat, HexStr(vch, fSpaces).c_str());
}
inline int64 GetPerformanceCounter()
{
int64 nCounter = 0;

0 comments on commit 4bbc2be

Please sign in to comment.