Skip to content

Commit

Permalink
Remove unused C++ code not covered by unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalswift authored and xanimo committed Jul 6, 2024
1 parent 962b020 commit 5d7acd9
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 32 deletions.
5 changes: 0 additions & 5 deletions src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,3 @@ std::string ChainNameFromCommandLine()
return CBaseChainParams::TESTNET;
return CBaseChainParams::MAIN;
}

bool AreBaseParamsConfigured()
{
return pCurrentBaseParams != NULL;
}
6 changes: 0 additions & 6 deletions src/chainparamsbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,4 @@ void SelectBaseParams(const std::string& chain);
*/
std::string ChainNameFromCommandLine();

/**
* Return true if SelectBaseParamsFromCommandLine() has been called to select
* a network.
*/
bool AreBaseParamsConfigured();

#endif // BITCOIN_CHAINPARAMSBASE_H
8 changes: 0 additions & 8 deletions src/key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,6 @@ void CKey::MakeNewKey(bool fCompressedIn) {
fCompressed = fCompressedIn;
}

bool CKey::SetPrivKey(const CPrivKey &privkey, bool fCompressedIn) {
if (!ec_privkey_import_der(secp256k1_context_sign, (unsigned char*)begin(), &privkey[0], privkey.size()))
return false;
fCompressed = fCompressedIn;
fValid = true;
return true;
}

CPrivKey CKey::GetPrivKey() const {
assert(fValid);
CPrivKey privkey;
Expand Down
3 changes: 0 additions & 3 deletions src/key.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ class CKey
//! Check whether the public key corresponding to this private key is (to be) compressed.
bool IsCompressed() const { return fCompressed; }

//! Initialize from a CPrivKey (serialized OpenSSL private key data).
bool SetPrivKey(const CPrivKey& vchPrivKey, bool fCompressed);

//! Generate a new private key using a cryptographic PRNG.
void MakeNewKey(bool fCompressed);

Expand Down
6 changes: 0 additions & 6 deletions src/netaddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,6 @@ bool CNetAddr::IsLocal() const
return false;
}

bool CNetAddr::IsMulticast() const
{
return (IsIPv4() && (GetByte(3) & 0xF0) == 0xE0)
|| (GetByte(15) == 0xFF);
}

bool CNetAddr::IsValid() const
{
// Cleanup 3-byte shifted addresses caused by garbage in size field
Expand Down
1 change: 0 additions & 1 deletion src/netaddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class CNetAddr
bool IsLocal() const;
bool IsRoutable() const;
bool IsValid() const;
bool IsMulticast() const;
enum Network GetNetwork() const;
std::string ToString() const;
std::string ToStringIP() const;
Expand Down
6 changes: 3 additions & 3 deletions src/script/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
{
static const CScriptNum bnZero(0);
static const CScriptNum bnOne(1);
static const CScriptNum bnFalse(0);
static const CScriptNum bnTrue(1);
// static const CScriptNum bnFalse(0);
// static const CScriptNum bnTrue(1);
static const valtype vchFalse(0);
static const valtype vchZero(0);
// static const valtype vchZero(0);
static const valtype vchTrue(1, 1);

CScript::const_iterator pc = script.begin();
Expand Down

0 comments on commit 5d7acd9

Please sign in to comment.