Skip to content

Commit 4c92401

Browse files
committed
Merge #10075: Remove unused C++ code not covered by unit tests
b51aaf1 Remove unused C++ code not covered by unit tests (practicalswift) Tree-SHA512: 267bbd87df01a296bf23e82a8b6ee968e13e23a6aaecc535d803890a3e3e9f6208c7fc4c1f97afd98ed3e498b12fe1ada7e3cb2977ad12359a813f57336c74e5
2 parents a550f6e + b51aaf1 commit 4c92401

File tree

9 files changed

+3
-42
lines changed

9 files changed

+3
-42
lines changed

src/chainparamsbase.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,3 @@ std::string ChainNameFromCommandLine()
103103
return CBaseChainParams::TESTNET;
104104
return CBaseChainParams::MAIN;
105105
}
106-
107-
bool AreBaseParamsConfigured()
108-
{
109-
return pCurrentBaseParams != NULL;
110-
}

src/chainparamsbase.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,4 @@ void SelectBaseParams(const std::string& chain);
5353
*/
5454
std::string ChainNameFromCommandLine();
5555

56-
/**
57-
* Return true if SelectBaseParamsFromCommandLine() has been called to select
58-
* a network.
59-
*/
60-
bool AreBaseParamsConfigured();
61-
6256
#endif // BITCOIN_CHAINPARAMSBASE_H

src/key.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,6 @@ void CKey::MakeNewKey(bool fCompressedIn) {
131131
fCompressed = fCompressedIn;
132132
}
133133

134-
bool CKey::SetPrivKey(const CPrivKey &privkey, bool fCompressedIn) {
135-
if (!ec_privkey_import_der(secp256k1_context_sign, (unsigned char*)begin(), &privkey[0], privkey.size()))
136-
return false;
137-
fCompressed = fCompressedIn;
138-
fValid = true;
139-
return true;
140-
}
141-
142134
CPrivKey CKey::GetPrivKey() const {
143135
assert(fValid);
144136
CPrivKey privkey;

src/key.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ class CKey
9494
//! Check whether the public key corresponding to this private key is (to be) compressed.
9595
bool IsCompressed() const { return fCompressed; }
9696

97-
//! Initialize from a CPrivKey (serialized OpenSSL private key data).
98-
bool SetPrivKey(const CPrivKey& vchPrivKey, bool fCompressed);
99-
10097
//! Generate a new private key using a cryptographic PRNG.
10198
void MakeNewKey(bool fCompressed);
10299

src/netaddress.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,6 @@ bool CNetAddr::IsLocal() const
179179
return false;
180180
}
181181

182-
bool CNetAddr::IsMulticast() const
183-
{
184-
return (IsIPv4() && (GetByte(3) & 0xF0) == 0xE0)
185-
|| (GetByte(15) == 0xFF);
186-
}
187-
188182
bool CNetAddr::IsValid() const
189183
{
190184
// Cleanup 3-byte shifted addresses caused by garbage in size field

src/netaddress.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class CNetAddr
6565
bool IsLocal() const;
6666
bool IsRoutable() const;
6767
bool IsValid() const;
68-
bool IsMulticast() const;
6968
enum Network GetNetwork() const;
7069
std::string ToString() const;
7170
std::string ToStringIP() const;

src/script/interpreter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,10 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
247247
{
248248
static const CScriptNum bnZero(0);
249249
static const CScriptNum bnOne(1);
250-
static const CScriptNum bnFalse(0);
251-
static const CScriptNum bnTrue(1);
250+
// static const CScriptNum bnFalse(0);
251+
// static const CScriptNum bnTrue(1);
252252
static const valtype vchFalse(0);
253-
static const valtype vchZero(0);
253+
// static const valtype vchZero(0);
254254
static const valtype vchTrue(1, 1);
255255

256256
CScript::const_iterator pc = script.begin();

src/wallet/db.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -466,15 +466,6 @@ void CDBEnv::CloseDb(const std::string& strFile)
466466
}
467467
}
468468

469-
bool CDBEnv::RemoveDb(const std::string& strFile)
470-
{
471-
this->CloseDb(strFile);
472-
473-
LOCK(cs_db);
474-
int rc = dbenv->dbremove(NULL, strFile.c_str(), NULL, DB_AUTO_COMMIT);
475-
return (rc == 0);
476-
}
477-
478469
bool CDB::Rewrite(CWalletDBWrapper& dbw, const char* pszSkip)
479470
{
480471
if (dbw.IsDummy()) {

src/wallet/db.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ class CDBEnv
7272
void CheckpointLSN(const std::string& strFile);
7373

7474
void CloseDb(const std::string& strFile);
75-
bool RemoveDb(const std::string& strFile);
7675

7776
DbTxn* TxnBegin(int flags = DB_TXN_WRITE_NOSYNC)
7877
{

0 commit comments

Comments
 (0)