Remove unused code

This commit is contained in:
practicalswift 2017-03-17 04:37:43 +01:00
parent 8040ae6fc5
commit 8dc957ae06
13 changed files with 0 additions and 78 deletions

View file

@ -483,22 +483,6 @@ static bool findSighashFlags(int& flags, const std::string& flagStr)
return false; return false;
} }
uint256 ParseHashUO(std::map<std::string,UniValue>& o, std::string strKey)
{
if (!o.count(strKey))
return uint256();
return ParseHashUV(o[strKey], strKey);
}
std::vector<unsigned char> ParseHexUO(std::map<std::string,UniValue>& o, std::string strKey)
{
if (!o.count(strKey)) {
std::vector<unsigned char> emptyVec;
return emptyVec;
}
return ParseHexUV(o[strKey], strKey);
}
static CAmount AmountFromValue(const UniValue& value) static CAmount AmountFromValue(const UniValue& value)
{ {
if (!value.isNum() && !value.isStr()) if (!value.isNum() && !value.isStr())

View file

@ -135,7 +135,6 @@ public:
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));
fMiningRequiresPeers = true;
fDefaultConsistencyChecks = false; fDefaultConsistencyChecks = false;
fRequireStandard = true; fRequireStandard = true;
fMineBlocksOnDemand = false; fMineBlocksOnDemand = false;
@ -235,7 +234,6 @@ public:
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test)); vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));
fMiningRequiresPeers = true;
fDefaultConsistencyChecks = false; fDefaultConsistencyChecks = false;
fRequireStandard = false; fRequireStandard = false;
fMineBlocksOnDemand = false; fMineBlocksOnDemand = false;
@ -307,7 +305,6 @@ public:
vFixedSeeds.clear(); //!< Regtest mode doesn't have any fixed seeds. vFixedSeeds.clear(); //!< Regtest mode doesn't have any fixed seeds.
vSeeds.clear(); //!< Regtest mode doesn't have any DNS seeds. vSeeds.clear(); //!< Regtest mode doesn't have any DNS seeds.
fMiningRequiresPeers = false;
fDefaultConsistencyChecks = true; fDefaultConsistencyChecks = true;
fRequireStandard = false; fRequireStandard = false;
fMineBlocksOnDemand = true; fMineBlocksOnDemand = true;

View file

@ -61,8 +61,6 @@ public:
int GetDefaultPort() const { return nDefaultPort; } int GetDefaultPort() const { return nDefaultPort; }
const CBlock& GenesisBlock() const { return genesis; } const CBlock& GenesisBlock() const { return genesis; }
/** Make miner wait to have peers to avoid wasting work */
bool MiningRequiresPeers() const { return fMiningRequiresPeers; }
/** Default value for -checkmempool and -checkblockindex argument */ /** Default value for -checkmempool and -checkblockindex argument */
bool DefaultConsistencyChecks() const { return fDefaultConsistencyChecks; } bool DefaultConsistencyChecks() const { return fDefaultConsistencyChecks; }
/** Policy: Filter transactions that do not match well-defined patterns */ /** Policy: Filter transactions that do not match well-defined patterns */
@ -89,7 +87,6 @@ protected:
std::string strNetworkID; std::string strNetworkID;
CBlock genesis; CBlock genesis;
std::vector<SeedSpec6> vFixedSeeds; std::vector<SeedSpec6> vFixedSeeds;
bool fMiningRequiresPeers;
bool fDefaultConsistencyChecks; bool fDefaultConsistencyChecks;
bool fRequireStandard; bool fRequireStandard;
bool fMineBlocksOnDemand; bool fMineBlocksOnDemand;

View file

@ -290,7 +290,6 @@ public:
virtual bool GetKey(uint256 &key) const = 0; virtual bool GetKey(uint256 &key) const = 0;
virtual bool GetValue(CCoins &coins) const = 0; virtual bool GetValue(CCoins &coins) const = 0;
/* Don't care about GetKeySize here */
virtual unsigned int GetValueSize() const = 0; virtual unsigned int GetValueSize() const = 0;
virtual bool Valid() const = 0; virtual bool Valid() const = 0;

View file

@ -132,10 +132,6 @@ public:
return true; return true;
} }
unsigned int GetKeySize() {
return piter->key().size();
}
template<typename V> bool GetValue(V& value) { template<typename V> bool GetValue(V& value) {
leveldb::Slice slValue = piter->value(); leveldb::Slice slValue = piter->value();
try { try {

View file

@ -146,13 +146,6 @@ public:
while (numThreads > 0) while (numThreads > 0)
cond.wait(lock); cond.wait(lock);
} }
/** Return current depth of queue */
size_t Depth()
{
std::unique_lock<std::mutex> lock(cs);
return queue.size();
}
}; };
struct HTTPPathHandler struct HTTPPathHandler

View file

@ -2406,11 +2406,6 @@ void CConnman::MarkAddressGood(const CAddress& addr)
addrman.Good(addr); addrman.Good(addr);
} }
void CConnman::AddNewAddress(const CAddress& addr, const CAddress& addrFrom, int64_t nTimePenalty)
{
addrman.Add(addr, addrFrom, nTimePenalty);
}
void CConnman::AddNewAddresses(const std::vector<CAddress>& vAddr, const CAddress& addrFrom, int64_t nTimePenalty) void CConnman::AddNewAddresses(const std::vector<CAddress>& vAddr, const CAddress& addrFrom, int64_t nTimePenalty)
{ {
addrman.Add(vAddr, addrFrom, nTimePenalty); addrman.Add(vAddr, addrFrom, nTimePenalty);

View file

@ -207,10 +207,8 @@ public:
size_t GetAddressCount() const; size_t GetAddressCount() const;
void SetServices(const CService &addr, ServiceFlags nServices); void SetServices(const CService &addr, ServiceFlags nServices);
void MarkAddressGood(const CAddress& addr); void MarkAddressGood(const CAddress& addr);
void AddNewAddress(const CAddress& addr, const CAddress& addrFrom, int64_t nTimePenalty = 0);
void AddNewAddresses(const std::vector<CAddress>& vAddr, const CAddress& addrFrom, int64_t nTimePenalty = 0); void AddNewAddresses(const std::vector<CAddress>& vAddr, const CAddress& addrFrom, int64_t nTimePenalty = 0);
std::vector<CAddress> GetAddresses(); std::vector<CAddress> GetAddresses();
void AddressCurrentlyConnected(const CService& addr);
// Denial-of-service detection/prevention // Denial-of-service detection/prevention
// The idea is to detect peers that are behaving // The idea is to detect peers that are behaving

View file

@ -28,7 +28,6 @@ namespace RPCServer
void OnStarted(boost::function<void ()> slot); void OnStarted(boost::function<void ()> slot);
void OnStopped(boost::function<void ()> slot); void OnStopped(boost::function<void ()> slot);
void OnPreCommand(boost::function<void (const CRPCCommand&)> slot); void OnPreCommand(boost::function<void (const CRPCCommand&)> slot);
void OnPostCommand(boost::function<void (const CRPCCommand&)> slot);
} }
class CBlockIndex; class CBlockIndex;

View file

@ -46,8 +46,6 @@ struct CLockLocation {
return mutexName + " " + sourceFile + ":" + itostr(sourceLine) + (fTry ? " (TRY)" : ""); return mutexName + " " + sourceFile + ":" + itostr(sourceLine) + (fTry ? " (TRY)" : "");
} }
std::string MutexName() const { return mutexName; }
bool fTry; bool fTry;
private: private:
std::string mutexName; std::string mutexName;

View file

@ -97,7 +97,6 @@ public:
} }
}; };
typedef CCriticalSection CDynamicCriticalSection;
/** Wrapped boost mutex: supports waiting but not recursive locking */ /** Wrapped boost mutex: supports waiting but not recursive locking */
typedef AnnotatedMixin<boost::mutex> CWaitableCriticalSection; typedef AnnotatedMixin<boost::mutex> CWaitableCriticalSection;

View file

@ -29,34 +29,6 @@ static const CBitcoinAddress addr2C("1CRj2HyM1CXWzHAXLQtiGLyggNT9WQqsDs");
static const std::string strAddressBad("1HV9Lc3sNHZxwj4Zk6fB38tEmBryq2cBiF"); static const std::string strAddressBad("1HV9Lc3sNHZxwj4Zk6fB38tEmBryq2cBiF");
#ifdef KEY_TESTS_DUMPINFO
void dumpKeyInfo(uint256 privkey)
{
CKey key;
key.resize(32);
memcpy(&secret[0], &privkey, 32);
std::vector<unsigned char> sec;
sec.resize(32);
memcpy(&sec[0], &secret[0], 32);
printf(" * secret (hex): %s\n", HexStr(sec).c_str());
for (int nCompressed=0; nCompressed<2; nCompressed++)
{
bool fCompressed = nCompressed == 1;
printf(" * %s:\n", fCompressed ? "compressed" : "uncompressed");
CBitcoinSecret bsecret;
bsecret.SetSecret(secret, fCompressed);
printf(" * secret (base58): %s\n", bsecret.ToString().c_str());
CKey key;
key.SetSecret(secret, fCompressed);
std::vector<unsigned char> vchPubKey = key.GetPubKey();
printf(" * pubkey (hex): %s\n", HexStr(vchPubKey).c_str());
printf(" * address (base58): %s\n", CBitcoinAddress(vchPubKey).ToString().c_str());
}
}
#endif
BOOST_FIXTURE_TEST_SUITE(key_tests, BasicTestingSetup) BOOST_FIXTURE_TEST_SUITE(key_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(key_test1) BOOST_AUTO_TEST_CASE(key_test1)

View file

@ -455,11 +455,6 @@ public:
{ {
return comment; return comment;
} }
const CScript& GetScriptPubKey()
{
return creditTx->vout[0].scriptPubKey;
}
}; };
std::string JSONPrettyPrint(const UniValue& univalue) std::string JSONPrettyPrint(const UniValue& univalue)