Skip to content

Commit d636f39

Browse files
committed
Merge #10536: Remove unreachable or otherwise redundant code
4265bf3 Remove unreachable or otherwise redundant code (practicalswift) Tree-SHA512: bc9666ab5d20c936d78c50c0361405aca9edd116602aa9bcd71a79a904b647ac9eca0651d1a9d530189a6ac1c4e235bfc69ec1a68f7e36cc14d6848ac2206b7b
2 parents c38f540 + 4265bf3 commit d636f39

File tree

6 files changed

+2
-16
lines changed

6 files changed

+2
-16
lines changed

src/bitcoin-tx.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ static void MutateTxAddOutPubKey(CMutableTransaction& tx, const std::string& str
299299
if (!pubkey.IsFullyValid())
300300
throw std::runtime_error("invalid TX output pubkey");
301301
CScript scriptPubKey = GetScriptForRawPubKey(pubkey);
302-
CBitcoinAddress addr(scriptPubKey);
303302

304303
// Extract and validate FLAGS
305304
bool bSegWit = false;

src/qt/test/rpcnestedtests.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ static const CRPCCommand vRPCCommands[] =
3333

3434
void RPCNestedTests::rpcNestedTests()
3535
{
36-
UniValue jsonRPCError;
37-
3836
// do some test setup
3937
// could be moved to a more generic place when we add more tests on QT level
4038
const CChainParams& chainparams = Params();

src/wallet/crypter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ bool CCryptoKeyStore::GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) co
274274
// Check for watch-only pubkeys
275275
return CBasicKeyStore::GetPubKey(address, vchPubKeyOut);
276276
}
277-
return false;
278277
}
279278

280279
bool CCryptoKeyStore::EncryptKeys(CKeyingMaterial& vMasterKeyIn)

src/wallet/rpcwallet.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,6 @@ class Witnessifier : public boost::static_visitor<bool>
10641064
bool operator()(const CNoDestination &dest) const { return false; }
10651065

10661066
bool operator()(const CKeyID &keyID) {
1067-
CPubKey pubkey;
10681067
if (pwallet) {
10691068
CScript basescript = GetScriptForDestination(keyID);
10701069
isminetype typ;

src/wallet/wallet.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ bool CWallet::AddCryptedKey(const CPubKey &vchPubKey,
205205
vchCryptedSecret,
206206
mapKeyMetadata[vchPubKey.GetID()]);
207207
}
208-
return false;
209208
}
210209

211210
bool CWallet::LoadKeyMetadata(const CTxDestination& keyID, const CKeyMetadata &meta)
@@ -2709,8 +2708,6 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
27092708

27102709
nBytes = GetVirtualTransactionSize(txNew);
27112710

2712-
CTransaction txNewConst(txNew);
2713-
27142711
// Remove scriptSigs to eliminate the fee calculation dummy signatures
27152712
for (auto& vin : txNew.vin) {
27162713
vin.scriptSig = CScript();

src/wallet/walletdb.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,15 @@ bool CWalletDB::WriteCryptedKey(const CPubKey& vchPubKey,
7676
const std::vector<unsigned char>& vchCryptedSecret,
7777
const CKeyMetadata &keyMeta)
7878
{
79-
const bool fEraseUnencryptedKey = true;
80-
8179
if (!WriteIC(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta)) {
8280
return false;
8381
}
8482

8583
if (!WriteIC(std::make_pair(std::string("ckey"), vchPubKey), vchCryptedSecret, false)) {
8684
return false;
8785
}
88-
if (fEraseUnencryptedKey)
89-
{
90-
EraseIC(std::make_pair(std::string("key"), vchPubKey));
91-
EraseIC(std::make_pair(std::string("wkey"), vchPubKey));
92-
}
93-
86+
EraseIC(std::make_pair(std::string("key"), vchPubKey));
87+
EraseIC(std::make_pair(std::string("wkey"), vchPubKey));
9488
return true;
9589
}
9690

0 commit comments

Comments
 (0)