Browse Source

Merge #8590: Remove unused variables

fa6dc9f Remove unused variables (MarcoFalke)
0.14
Wladimir J. van der Laan 8 years ago
parent
commit
12892dbb9f
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 4
      src/bitcoin-tx.cpp
  2. 2
      src/init.cpp
  3. 1
      src/txmempool.cpp
  4. 1
      src/wallet/wallet.cpp

4
src/bitcoin-tx.cpp

@ -395,10 +395,8 @@ static void MutateTxSign(CMutableTransaction& tx, const string& flagStr)
if (!registers.count("privatekeys")) if (!registers.count("privatekeys"))
throw runtime_error("privatekeys register variable must be set."); throw runtime_error("privatekeys register variable must be set.");
bool fGivenKeys = false;
CBasicKeyStore tempKeystore; CBasicKeyStore tempKeystore;
UniValue keysObj = registers["privatekeys"]; UniValue keysObj = registers["privatekeys"];
fGivenKeys = true;
for (unsigned int kidx = 0; kidx < keysObj.size(); kidx++) { for (unsigned int kidx = 0; kidx < keysObj.size(); kidx++) {
if (!keysObj[kidx].isStr()) if (!keysObj[kidx].isStr())
@ -454,7 +452,7 @@ static void MutateTxSign(CMutableTransaction& tx, const string& flagStr)
// if redeemScript given and private keys given, // if redeemScript given and private keys given,
// add redeemScript to the tempKeystore so it can be signed: // add redeemScript to the tempKeystore so it can be signed:
if (fGivenKeys && (scriptPubKey.IsPayToScriptHash() || scriptPubKey.IsPayToWitnessScriptHash()) && if ((scriptPubKey.IsPayToScriptHash() || scriptPubKey.IsPayToWitnessScriptHash()) &&
prevOut.exists("redeemScript")) { prevOut.exists("redeemScript")) {
UniValue v = prevOut["redeemScript"]; UniValue v = prevOut["redeemScript"];
vector<unsigned char> rsData(ParseHexUV(v, "redeemScript")); vector<unsigned char> rsData(ParseHexUV(v, "redeemScript"));

2
src/init.cpp

@ -1183,8 +1183,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
fNameLookup = GetBoolArg("-dns", DEFAULT_NAME_LOOKUP); fNameLookup = GetBoolArg("-dns", DEFAULT_NAME_LOOKUP);
fRelayTxes = !GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY); fRelayTxes = !GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY);
bool fBound = false;
if (fListen) { if (fListen) {
bool fBound = false;
if (mapArgs.count("-bind") || mapArgs.count("-whitebind")) { if (mapArgs.count("-bind") || mapArgs.count("-whitebind")) {
BOOST_FOREACH(const std::string& strBind, mapMultiArgs["-bind"]) { BOOST_FOREACH(const std::string& strBind, mapMultiArgs["-bind"]) {
CService addrBind; CService addrBind;

1
src/txmempool.cpp

@ -576,7 +576,6 @@ void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMem
void CTxMemPool::removeConflicts(const CTransaction &tx, std::list<CTransaction>& removed) void CTxMemPool::removeConflicts(const CTransaction &tx, std::list<CTransaction>& removed)
{ {
// Remove transactions which depend on inputs of tx, recursively // Remove transactions which depend on inputs of tx, recursively
list<CTransaction> result;
LOCK(cs); LOCK(cs);
BOOST_FOREACH(const CTxIn &txin, tx.vin) { BOOST_FOREACH(const CTxIn &txin, tx.vin) {
auto it = mapNextTx.find(txin.prevout); auto it = mapNextTx.find(txin.prevout);

1
src/wallet/wallet.cpp

@ -2461,7 +2461,6 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey)
AddToWallet(wtxNew); AddToWallet(wtxNew);
// Notify that old coins are spent // Notify that old coins are spent
set<CWalletTx*> setCoins;
BOOST_FOREACH(const CTxIn& txin, wtxNew.vin) BOOST_FOREACH(const CTxIn& txin, wtxNew.vin)
{ {
CWalletTx &coin = mapWallet[txin.prevout.hash]; CWalletTx &coin = mapWallet[txin.prevout.hash];

Loading…
Cancel
Save