diff --git a/src/qt/bitcoinaddressvalidator.h b/src/qt/bitcoinaddressvalidator.h --- a/src/qt/bitcoinaddressvalidator.h +++ b/src/qt/bitcoinaddressvalidator.h @@ -16,7 +16,7 @@ Q_OBJECT public: - explicit BitcoinAddressEntryValidator(const std::string &cashaddrprefix, + explicit BitcoinAddressEntryValidator(const std::string &cashaddrprefixIn, QObject *parent); State validate(QString &input, int &pos) const override; diff --git a/src/qt/bitcoinaddressvalidator.cpp b/src/qt/bitcoinaddressvalidator.cpp --- a/src/qt/bitcoinaddressvalidator.cpp +++ b/src/qt/bitcoinaddressvalidator.cpp @@ -18,8 +18,8 @@ - All lower-case letters except for 'l' */ BitcoinAddressEntryValidator::BitcoinAddressEntryValidator( - const std::string &cashaddrprefix, QObject *parent) - : QValidator(parent), cashaddrprefix(cashaddrprefix) {} + const std::string &cashaddrprefixIn, QObject *parent) + : QValidator(parent), cashaddrprefix(cashaddrprefixIn) {} QValidator::State BitcoinAddressEntryValidator::validate(QString &input, int &pos) const { diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -131,7 +131,7 @@ int spinnerFrame; const PlatformStyle *platformStyle; - const Config *cfg; + const Config *config; /** Create the main UI actions. */ void createActions(); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -74,7 +74,8 @@ */ const QString BitcoinGUI::DEFAULT_WALLET = "~Default"; -BitcoinGUI::BitcoinGUI(const Config *cfg, const PlatformStyle *_platformStyle, +BitcoinGUI::BitcoinGUI(const Config *configIn, + const PlatformStyle *_platformStyle, const NetworkStyle *networkStyle, QWidget *parent) : QMainWindow(parent), enableWallet(false), clientModel(0), walletFrame(0), unitDisplayControl(0), labelWalletEncryptionIcon(0), @@ -89,7 +90,7 @@ aboutQtAction(0), openRPCConsoleAction(0), openAction(0), showHelpMessageAction(0), trayIcon(0), trayIconMenu(0), notificator(0), rpcConsole(0), helpMessageDialog(0), modalOverlay(0), prevBlocks(0), - spinnerFrame(0), platformStyle(_platformStyle), cfg(cfg) { + spinnerFrame(0), platformStyle(_platformStyle), config(configIn) { GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); QString windowTitle = tr(PACKAGE_NAME) + " - "; @@ -115,7 +116,7 @@ #ifdef ENABLE_WALLET if (enableWallet) { /** Create wallet frame and make it the central widget */ - walletFrame = new WalletFrame(_platformStyle, cfg, this); + walletFrame = new WalletFrame(_platformStyle, config, this); setCentralWidget(walletFrame); } else #endif // ENABLE_WALLET @@ -273,7 +274,7 @@ tr("&Receive"), this); receiveCoinsAction->setStatusTip( tr("Request payments (generates QR codes and %1: URIs)") - .arg(GUIUtil::bitcoinURIScheme(*cfg))); + .arg(GUIUtil::bitcoinURIScheme(*config))); receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip()); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); @@ -399,7 +400,7 @@ openAction = new QAction(platformStyle->TextColorIcon(":/icons/open"), tr("Open &URI..."), this); openAction->setStatusTip(tr("Open a %1: URI or payment request") - .arg(GUIUtil::bitcoinURIScheme(*cfg))); + .arg(GUIUtil::bitcoinURIScheme(*config))); showHelpMessageAction = new QAction(platformStyle->TextColorIcon(":/icons/info"), @@ -700,7 +701,7 @@ #ifdef ENABLE_WALLET void BitcoinGUI::openClicked() { - OpenURIDialog dlg(cfg, this); + OpenURIDialog dlg(config, this); if (dlg.exec()) { Q_EMIT receivedURI(dlg.getURI()); } diff --git a/src/qt/openuridialog.h b/src/qt/openuridialog.h --- a/src/qt/openuridialog.h +++ b/src/qt/openuridialog.h @@ -17,7 +17,7 @@ Q_OBJECT public: - explicit OpenURIDialog(const Config *cfg, QWidget *parent); + explicit OpenURIDialog(const Config *configIn, QWidget *parent); ~OpenURIDialog(); QString getURI(); @@ -30,7 +30,7 @@ private: Ui::OpenURIDialog *ui; - const Config *cfg; + const Config *config; }; #endif // BITCOIN_QT_OPENURIDIALOG_H diff --git a/src/qt/openuridialog.cpp b/src/qt/openuridialog.cpp --- a/src/qt/openuridialog.cpp +++ b/src/qt/openuridialog.cpp @@ -10,10 +10,10 @@ #include -OpenURIDialog::OpenURIDialog(const Config *cfg, QWidget *parent) - : QDialog(parent), ui(new Ui::OpenURIDialog), cfg(cfg) { +OpenURIDialog::OpenURIDialog(const Config *configIn, QWidget *parent) + : QDialog(parent), ui(new Ui::OpenURIDialog), config(configIn) { ui->setupUi(this); - ui->uriEdit->setPlaceholderText(GUIUtil::bitcoinURIScheme(*cfg) + ":"); + ui->uriEdit->setPlaceholderText(GUIUtil::bitcoinURIScheme(*config) + ":"); } OpenURIDialog::~OpenURIDialog() { @@ -26,7 +26,7 @@ void OpenURIDialog::accept() { SendCoinsRecipient rcp; - QString uriScheme = GUIUtil::bitcoinURIScheme(*cfg); + QString uriScheme = GUIUtil::bitcoinURIScheme(*config); if (GUIUtil::parseBitcoinURI(uriScheme, getURI(), &rcp)) { /* Only accept value URIs */ QDialog::accept(); @@ -40,6 +40,6 @@ this, tr("Select payment request file to open"), "", "", nullptr); if (filename.isEmpty()) return; QUrl fileUri = QUrl::fromLocalFile(filename); - ui->uriEdit->setText(GUIUtil::bitcoinURIScheme(*cfg) + + ui->uriEdit->setText(GUIUtil::bitcoinURIScheme(*config) + ":?r=" + QUrl::toPercentEncoding(fileUri.toString())); } diff --git a/src/qt/receivecoinsdialog.h b/src/qt/receivecoinsdialog.h --- a/src/qt/receivecoinsdialog.h +++ b/src/qt/receivecoinsdialog.h @@ -41,7 +41,7 @@ }; explicit ReceiveCoinsDialog(const PlatformStyle *platformStyle, - const Config *cfg, QWidget *parent = 0); + const Config *configIn, QWidget *parent = 0); ~ReceiveCoinsDialog(); void setModel(WalletModel *model); @@ -60,7 +60,7 @@ WalletModel *model; QMenu *contextMenu; const PlatformStyle *platformStyle; - const Config *cfg; + const Config *config; QModelIndex selectedRow(); void copyColumnToClipboard(int column); diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -23,9 +23,9 @@ #include ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, - const Config *cfg, QWidget *parent) + const Config *configIn, QWidget *parent) : QDialog(parent), ui(new Ui::ReceiveCoinsDialog), columnResizingFixer(0), - model(0), platformStyle(_platformStyle), cfg(cfg) { + model(0), platformStyle(_platformStyle), config(configIn) { ui->setupUi(this); if (!_platformStyle->getImagesOnButtons()) { @@ -159,7 +159,7 @@ } SendCoinsRecipient info(address, label, ui->reqAmount->value(), ui->reqMessage->text()); - ReceiveRequestDialog *dialog = new ReceiveRequestDialog(cfg, this); + ReceiveRequestDialog *dialog = new ReceiveRequestDialog(config, this); dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->setModel(model->getOptionsModel()); dialog->setInfo(info); @@ -174,7 +174,7 @@ const QModelIndex &index) { const RecentRequestsTableModel *submodel = model->getRecentRequestsTableModel(); - ReceiveRequestDialog *dialog = new ReceiveRequestDialog(cfg, this); + ReceiveRequestDialog *dialog = new ReceiveRequestDialog(config, this); dialog->setModel(model->getOptionsModel()); dialog->setInfo(submodel->entry(index.row()).recipient); dialog->setAttribute(Qt::WA_DeleteOnClose); @@ -277,8 +277,8 @@ const RecentRequestsTableModel *const submodel = model->getRecentRequestsTableModel(); - const QString uri = - GUIUtil::formatBitcoinURI(*cfg, submodel->entry(sel.row()).recipient); + const QString uri = GUIUtil::formatBitcoinURI( + *config, submodel->entry(sel.row()).recipient); GUIUtil::setClipboard(uri); } diff --git a/src/qt/receiverequestdialog.h b/src/qt/receiverequestdialog.h --- a/src/qt/receiverequestdialog.h +++ b/src/qt/receiverequestdialog.h @@ -50,7 +50,7 @@ Q_OBJECT public: - explicit ReceiveRequestDialog(const Config *config, QWidget *parent = 0); + explicit ReceiveRequestDialog(const Config *configIn, QWidget *parent = 0); ~ReceiveRequestDialog(); void setModel(OptionsModel *model); diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp --- a/src/qt/receiverequestdialog.cpp +++ b/src/qt/receiverequestdialog.cpp @@ -76,10 +76,10 @@ contextMenu->exec(event->globalPos()); } -ReceiveRequestDialog::ReceiveRequestDialog(const Config *config, +ReceiveRequestDialog::ReceiveRequestDialog(const Config *configIn, QWidget *parent) : QDialog(parent), ui(new Ui::ReceiveRequestDialog), model(0), - config(config) { + config(configIn) { ui->setupUi(this); #ifndef USE_QRCODE diff --git a/src/qt/test/uritests.cpp b/src/qt/test/uritests.cpp --- a/src/qt/test/uritests.cpp +++ b/src/qt/test/uritests.cpp @@ -175,8 +175,8 @@ namespace { class UriTestConfig : public DummyConfig { public: - UriTestConfig(bool useCashAddr) - : DummyConfig(CBaseChainParams::MAIN), useCashAddr(useCashAddr) {} + UriTestConfig(bool useCashAddrIn) + : DummyConfig(CBaseChainParams::MAIN), useCashAddr(useCashAddrIn) {} bool UseCashAddrEncoding() const override { return useCashAddr; } private: diff --git a/src/qt/walletframe.h b/src/qt/walletframe.h --- a/src/qt/walletframe.h +++ b/src/qt/walletframe.h @@ -31,8 +31,8 @@ Q_OBJECT public: - explicit WalletFrame(const PlatformStyle *platformStyle, const Config *cfg, - BitcoinGUI *_gui = 0); + explicit WalletFrame(const PlatformStyle *platformStyle, + const Config *configIn, BitcoinGUI *_gui = 0); ~WalletFrame(); void setClientModel(ClientModel *clientModel); @@ -60,7 +60,7 @@ bool bOutOfSync; const PlatformStyle *platformStyle; - const Config *cfg; + const Config *config; WalletView *currentWalletView(); diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -12,9 +12,9 @@ #include #include -WalletFrame::WalletFrame(const PlatformStyle *_platformStyle, const Config *cfg, - BitcoinGUI *_gui) - : QFrame(_gui), gui(_gui), platformStyle(_platformStyle), cfg(cfg) { +WalletFrame::WalletFrame(const PlatformStyle *_platformStyle, + const Config *configIn, BitcoinGUI *_gui) + : QFrame(_gui), gui(_gui), platformStyle(_platformStyle), config(configIn) { // Leave HBox hook for adding a list view later QHBoxLayout *walletFrameLayout = new QHBoxLayout(this); setContentsMargins(0, 0, 0, 0); @@ -37,7 +37,7 @@ if (!gui || !clientModel || !walletModel || mapWalletViews.count(name) > 0) return false; - WalletView *walletView = new WalletView(platformStyle, cfg, this); + WalletView *walletView = new WalletView(platformStyle, config, this); walletView->setBitcoinGUI(gui); walletView->setClientModel(clientModel); walletView->setWalletModel(walletModel); diff --git a/src/seeder/bitcoin.cpp b/src/seeder/bitcoin.cpp --- a/src/seeder/bitcoin.cpp +++ b/src/seeder/bitcoin.cpp @@ -117,7 +117,7 @@ } } - bool ProcessMessage(std::string strCommand, CDataStream &vRecv) { + bool ProcessMessage(std::string strCommand, CDataStream &recv) { // printf("%s: RECV %s\n", ToString(you).c_str(), // strCommand.c_str()); if (strCommand == "version") { @@ -126,12 +126,12 @@ CAddress addrFrom; uint64_t nNonce = 1; uint64_t nServiceInt; - vRecv >> nVersion >> nServiceInt >> nTime >> addrMe; + recv >> nVersion >> nServiceInt >> nTime >> addrMe; you.nServices = ServiceFlags(nServiceInt); if (nVersion == 10300) nVersion = 300; - if (nVersion >= 106 && !vRecv.empty()) vRecv >> addrFrom >> nNonce; - if (nVersion >= 106 && !vRecv.empty()) vRecv >> strSubVer; - if (nVersion >= 209 && !vRecv.empty()) vRecv >> nStartingHeight; + if (nVersion >= 106 && !recv.empty()) recv >> addrFrom >> nNonce; + if (nVersion >= 106 && !recv.empty()) recv >> strSubVer; + if (nVersion >= 209 && !recv.empty()) recv >> nStartingHeight; if (nVersion >= 209) { BeginMessage("verack"); @@ -139,21 +139,21 @@ } vSend.SetVersion(std::min(nVersion, PROTOCOL_VERSION)); if (nVersion < 209) { - this->vRecv.SetVersion(std::min(nVersion, PROTOCOL_VERSION)); + vRecv.SetVersion(std::min(nVersion, PROTOCOL_VERSION)); GotVersion(); } return false; } if (strCommand == "verack") { - this->vRecv.SetVersion(std::min(nVersion, PROTOCOL_VERSION)); + vRecv.SetVersion(std::min(nVersion, PROTOCOL_VERSION)); GotVersion(); return false; } if (strCommand == "addr" && vAddr) { std::vector vAddrNew; - vRecv >> vAddrNew; + recv >> vAddrNew; // printf("%s: got %i addresses\n", ToString(you).c_str(), // (int)vAddrNew.size()); int64_t now = time(nullptr); diff --git a/src/seeder/dns.cpp b/src/seeder/dns.cpp --- a/src/seeder/dns.cpp +++ b/src/seeder/dns.cpp @@ -465,19 +465,19 @@ typ == TYPE_AAAA || typ == QTYPE_ANY); int n = 0; while (n < naddr) { - int ret = 1; + int mustbreak = 1; if (addr[n].v == 4) { - ret = write_record_a(&outpos, outend - max_auth_size, "", - offset, CLASS_IN, opt->datattl, - &addr[n]); + mustbreak = write_record_a(&outpos, outend - max_auth_size, + "", offset, CLASS_IN, + opt->datattl, &addr[n]); } else if (addr[n].v == 6) { - ret = write_record_aaaa(&outpos, outend - max_auth_size, "", - offset, CLASS_IN, opt->datattl, - &addr[n]); + mustbreak = write_record_aaaa( + &outpos, outend - max_auth_size, "", offset, CLASS_IN, + opt->datattl, &addr[n]); } - // printf("wrote A record: %i\n", ret); - if (ret) { + // printf("wrote A record: %i\n", mustbreak); + if (mustbreak) { break; } diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -209,7 +209,6 @@ } void TestCoinbaseMessageEB(uint64_t eb, std::string cbmsg) { - GlobalConfig config; config.SetMaxBlockSize(eb); @@ -260,11 +259,11 @@ entry.dPriority = 111.0; entry.nHeight = 11; - GlobalConfig config; - LOCK(cs_main); fCheckpointsEnabled = false; + GlobalConfig config; + // Simple block creation, nothing special yet: BOOST_CHECK(pblocktemplate = BlockAssembler(config).CreateNewBlock(scriptPubKey)); @@ -522,7 +521,7 @@ // non-final txs in mempool SetMockTime(chainActive.Tip()->GetMedianTimePast() + 1); - int flags = LOCKTIME_VERIFY_SEQUENCE | LOCKTIME_MEDIAN_TIME_PAST; + uint32_t flags = LOCKTIME_VERIFY_SEQUENCE | LOCKTIME_MEDIAN_TIME_PAST; // height map std::vector prevheights; @@ -547,7 +546,6 @@ { // Locktime passes. - GlobalConfig config; CValidationState state; BOOST_CHECK(ContextualCheckTransactionForCurrentBlock( config, CTransaction(tx), state, flags)); @@ -574,7 +572,6 @@ { // Locktime passes. - GlobalConfig config; CValidationState state; BOOST_CHECK(ContextualCheckTransactionForCurrentBlock( config, CTransaction(tx), state, flags)); @@ -608,7 +605,6 @@ { // Locktime fails. - GlobalConfig config; CValidationState state; BOOST_CHECK(!ContextualCheckTransactionForCurrentBlock( config, CTransaction(tx), state, flags)); @@ -620,7 +616,6 @@ { // Locktime passes on 2nd block. - GlobalConfig config; CValidationState state; int64_t nMedianTimePast = chainActive.Tip()->GetMedianTimePast(); BOOST_CHECK(ContextualCheckTransaction( @@ -638,7 +633,6 @@ { // Locktime fails. - GlobalConfig config; CValidationState state; BOOST_CHECK(!ContextualCheckTransactionForCurrentBlock( config, CTransaction(tx), state, flags)); @@ -650,7 +644,6 @@ { // Locktime passes 1 second later. - GlobalConfig config; CValidationState state; int64_t nMedianTimePast = chainActive.Tip()->GetMedianTimePast() + 1; BOOST_CHECK(ContextualCheckTransaction( @@ -666,7 +659,6 @@ { // Locktime passes. - GlobalConfig config; CValidationState state; BOOST_CHECK(ContextualCheckTransactionForCurrentBlock( config, CTransaction(tx), state, flags)); diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -148,7 +148,7 @@ } static void DoTest(const CScript &scriptPubKey, const CScript &scriptSig, - int flags, const std::string &message, int scriptError, + uint32_t flags, const std::string &message, int scriptError, const Amount nValue) { bool expect = (scriptError == SCRIPT_ERR_OK); if (flags & SCRIPT_VERIFY_CLEANSTACK) { @@ -173,7 +173,8 @@ #if defined(HAVE_CONSENSUS_LIB) CDataStream stream(SER_NETWORK, PROTOCOL_VERSION); stream << tx2; - int libconsensus_flags = flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL; + uint32_t libconsensus_flags = + flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL; if (libconsensus_flags == flags) { if (flags & bitcoinconsensus_SCRIPT_ENABLE_SIGHASH_FORKID) { BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script_with_amount( @@ -243,7 +244,7 @@ bool havePush; std::vector push; std::string comment; - int flags; + uint32_t flags; int scriptError; Amount nValue; @@ -282,8 +283,9 @@ } public: - TestBuilder(const CScript &script_, const std::string &comment_, int flags_, - bool P2SH = false, Amount nValue_ = Amount::zero()) + TestBuilder(const CScript &script_, const std::string &comment_, + uint32_t flags_, bool P2SH = false, + Amount nValue_ = Amount::zero()) : script(script_), havePush(false), comment(comment_), flags(flags_), scriptError(SCRIPT_ERR_OK), nValue(nValue_) { CScript scriptPubKey = script; @@ -334,9 +336,9 @@ SigHashType sigHashType = SigHashType(), unsigned int lenR = 32, unsigned int lenS = 32, Amount amount = Amount::zero(), - uint32_t flags = SCRIPT_ENABLE_SIGHASH_FORKID) { + uint32_t sigFlags = SCRIPT_ENABLE_SIGHASH_FORKID) { uint256 hash = SignatureHash(script, CTransaction(spendTx), 0, - sigHashType, amount, nullptr, flags); + sigHashType, amount, nullptr, sigFlags); std::vector vchSig = DoSign(key, hash, lenR, lenS); vchSig.push_back(static_cast(sigHashType.getRawSigHashType())); DoPush(vchSig); diff --git a/src/test/txvalidationcache_tests.cpp b/src/test/txvalidationcache_tests.cpp --- a/src/test/txvalidationcache_tests.cpp +++ b/src/test/txvalidationcache_tests.cpp @@ -23,7 +23,7 @@ BOOST_AUTO_TEST_SUITE(txvalidationcache_tests) -static bool ToMemPool(CMutableTransaction &tx) { +static bool ToMemPool(const CMutableTransaction &tx) { LOCK(cs_main); CValidationState state; @@ -205,8 +205,8 @@ // Test that invalidity under a set of flags doesn't preclude validity under // other (eg consensus) flags. // spend_tx is invalid according to DERSIG - CValidationState state; { + CValidationState state; PrecomputedTransactionData ptd_spend_tx(spend_tx); BOOST_CHECK(!CheckInputs(spend_tx, state, pcoinsTip, true, diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -383,7 +383,7 @@ bool CWallet::Unlock(const SecureString &strWalletPassphrase) { CCrypter crypter; - CKeyingMaterial vMasterKey; + CKeyingMaterial _vMasterKey; LOCK(cs_wallet); for (const MasterKeyMap::value_type &pMasterKey : mapMasterKeys) { @@ -394,12 +394,12 @@ return false; } - if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, vMasterKey)) { + if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, _vMasterKey)) { // try another master key continue; } - if (CCryptoKeyStore::Unlock(vMasterKey)) { + if (CCryptoKeyStore::Unlock(_vMasterKey)) { return true; } } @@ -416,7 +416,7 @@ Lock(); CCrypter crypter; - CKeyingMaterial vMasterKey; + CKeyingMaterial _vMasterKey; for (MasterKeyMap::value_type &pMasterKey : mapMasterKeys) { if (!crypter.SetKeyFromPassphrase( strOldWalletPassphrase, pMasterKey.second.vchSalt, @@ -425,11 +425,11 @@ return false; } - if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, vMasterKey)) { + if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, _vMasterKey)) { return false; } - if (CCryptoKeyStore::Unlock(vMasterKey)) { + if (CCryptoKeyStore::Unlock(_vMasterKey)) { int64_t nStartTime = GetTimeMillis(); crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, @@ -465,7 +465,8 @@ return false; } - if (!crypter.Encrypt(vMasterKey, pMasterKey.second.vchCryptedKey)) { + if (!crypter.Encrypt(_vMasterKey, + pMasterKey.second.vchCryptedKey)) { return false; } @@ -660,10 +661,10 @@ return false; } - CKeyingMaterial vMasterKey; + CKeyingMaterial _vMasterKey; - vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE); - GetStrongRandBytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE); + _vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE); + GetStrongRandBytes(&_vMasterKey[0], WALLET_CRYPTO_KEY_SIZE); CMasterKey kMasterKey; @@ -700,7 +701,7 @@ return false; } - if (!crypter.Encrypt(vMasterKey, kMasterKey.vchCryptedKey)) { + if (!crypter.Encrypt(_vMasterKey, kMasterKey.vchCryptedKey)) { return false; } @@ -716,7 +717,7 @@ } pwalletdbEncryption->WriteMasterKey(nMasterKeyMaxID, kMasterKey); - if (!EncryptKeys(vMasterKey)) { + if (!EncryptKeys(_vMasterKey)) { pwalletdbEncryption->TxnAbort(); delete pwalletdbEncryption; // We now probably have half of our keys encrypted in memory, and @@ -774,8 +775,6 @@ // First: get all CWalletTx and CAccountingEntry into a sorted-by-time // multimap. - typedef std::pair TxPair; - typedef std::multimap TxItems; TxItems txByTime; for (std::map::iterator it = mapWallet.begin();