diff --git a/src/init.cpp b/src/init.cpp index 97a5695175..22d09d28e9 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -109,7 +109,11 @@ static const char* DEFAULT_ASMAP_FILENAME="ip_asn.map"; /** * The PID file facilities. */ -static const char* BITCOIN_PID_FILENAME = "bitcoind.pid"; +#ifdef LIQUID +const char * const BITCOIN_PID_FILENAME = "liquid.pid"; +#else +const char * const BITCOIN_PID_FILENAME = "elementsd.pid"; +#endif static fs::path GetPidFile(const ArgsManager& args) { diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index fe65fa02ee..c796daa711 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -24,11 +24,6 @@ #include -/* Minimum free space (in GB) needed for data directory */ -constexpr uint64_t BLOCK_CHAIN_SIZE = 1; -/* Minimum free space (in GB) needed for data directory when pruned; Does not include prune target */ -static const uint64_t CHAIN_STATE_SIZE = 0; - /* Check free space asynchronously to prevent hanging the UI thread. Up to one request to check a path is in flight to this thread; when the check() diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp index b0cf7f3ef7..a5f13d25e8 100644 --- a/src/qt/test/wallettests.cpp +++ b/src/qt/test/wallettests.cpp @@ -226,11 +226,11 @@ void TestGUI(interfaces::Node& node) int initialRowCount = requestTableModel->rowCount({}); QPushButton* requestPaymentButton = receiveCoinsDialog.findChild("receiveButton"); requestPaymentButton->click(); + /* URI are disabled for Elements-QT for (QWidget* widget : QApplication::topLevelWidgets()) { if (widget->inherits("ReceiveRequestDialog")) { ReceiveRequestDialog* receiveRequestDialog = qobject_cast(widget); - /* URI are disabled for Elements-QT QCOMPARE(receiveRequestDialog->QObject::findChild("payment_header")->text(), QString("Payment information")); QCOMPARE(receiveRequestDialog->QObject::findChild("uri_tag")->text(), QString("URI:")); QString uri = receiveRequestDialog->QObject::findChild("uri_content")->text(); @@ -248,9 +248,9 @@ void TestGUI(interfaces::Node& node) QCOMPARE(uri.count("message=TEST_MESSAGE_1"), 2); QCOMPARE(receiveRequestDialog->QObject::findChild("message_tag")->text(), QString("Message:")); QCOMPARE(receiveRequestDialog->QObject::findChild("message_content")->text(), QString("TEST_MESSAGE_1")); - */ } } + */ // Clear button QPushButton* clearButton = receiveCoinsDialog.findChild("clearButton"); diff --git a/src/txmempool.h b/src/txmempool.h index bfa895534e..8457fed63e 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -629,7 +629,7 @@ public: void addUnchecked(const CTxMemPoolEntry& entry, setEntries& setAncestors, bool validFeeEstimate = true) EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main); void removeRecursive(const CTransaction &tx, MemPoolRemovalReason reason) EXCLUSIVE_LOCKS_REQUIRED(cs); - void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags) EXCLUSIVE_LOCKS_REQUIRED(cs_main); + void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags) EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main); void removeConflicts(const CTransaction &tx) EXCLUSIVE_LOCKS_REQUIRED(cs); void removeForBlock(const std::vector& vtx, unsigned int nBlockHeight, const CBlockIndex* p_block_index_new = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs); diff --git a/src/util/system.cpp b/src/util/system.cpp index e4e616c3da..f5e261e86f 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -73,10 +73,8 @@ const int64_t nStartupTime = GetTime(); #ifdef LIQUID const char * const BITCOIN_CONF_FILENAME = "liquid.conf"; -const char * const BITCOIN_PID_FILENAME = "liquid.pid"; #else const char * const BITCOIN_CONF_FILENAME = "elements.conf"; -const char * const BITCOIN_PID_FILENAME = "elementsd.pid"; #endif const char * const BITCOIN_SETTINGS_FILENAME = "settings.json"; diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 8a9baac486..ca6488e1d9 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3676,7 +3676,6 @@ RPCHelpMan signrawtransactionwithwallet() EnsureWalletIsUnlocked(pwallet); // Fetch previous transactions (inputs): - const auto& fedpegscripts = GetValidFedpegScripts(::ChainActive().Tip(), Params().GetConsensus(), true /* nextblock_validation */); std::map coins; for (const CTxIn& txin : mtx.vin) { coins[txin.prevout]; // Create empty map entry keyed by prevout. @@ -6520,7 +6519,6 @@ static RPCHelpMan issueasset() token_dest_blindpub = pwallet->GetBlindingPubKey(GetScriptForDestination(token_dest)); } - uint256 dummyentropy; CAsset dummyasset; IssuanceDetails issuance_details; issuance_details.blind_issuance = blind_issuances; diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index afe6f12fde..f2f737557a 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -336,7 +336,11 @@ public: // memory only enum AmountType { DEBIT, CREDIT, IMMATURE_CREDIT, AVAILABLE_CREDIT, AMOUNTTYPE_ENUM_ELEMENTS }; - CAmountMap GetCachableAmount(AmountType type, const isminefilter& filter, bool recalculate = false) const; + // TODO: Remove "NO_THREAD_SAFETY_ANALYSIS" and replace it with the correct + // annotation "EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)". The + // annotation "NO_THREAD_SAFETY_ANALYSIS" was temporarily added to avoid + // having to resolve the issue of member access into incomplete type CWallet. + CAmountMap GetCachableAmount(AmountType type, const isminefilter& filter, bool recalculate = false) const NO_THREAD_SAFETY_ANALYSIS; mutable CachableAmountMap m_amounts[AMOUNTTYPE_ENUM_ELEMENTS]; /** * This flag is true if all m_amounts caches are empty. This is particularly @@ -485,7 +489,11 @@ public: // having to resolve the issue of member access into incomplete type CWallet. CAmountMap GetAvailableCredit(bool fUseCache=true, const isminefilter& filter=ISMINE_SPENDABLE) const NO_THREAD_SAFETY_ANALYSIS; CAmountMap GetImmatureWatchOnlyCredit(const bool fUseCache=true) const; - CAmountMap GetChange() const; + // TODO: Remove "NO_THREAD_SAFETY_ANALYSIS" and replace it with the correct + // annotation "EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)". The + // annotation "NO_THREAD_SAFETY_ANALYSIS" was temporarily added to avoid + // having to resolve the issue of member access into incomplete type CWallet. + CAmountMap GetChange() const NO_THREAD_SAFETY_ANALYSIS; // Get the marginal bytes if spending the specified output from this transaction int GetSpendSize(unsigned int out, bool use_max_sig = false) const @@ -836,7 +844,7 @@ public: * if they are not ours */ bool SelectCoins(const std::vector& vAvailableCoins, const CAmountMap& mapTargetValue, std::set& setCoinsRet, CAmountMap& mapValueRet, - const CCoinControl& coin_control, CoinSelectionParams& coin_selection_params, bool& bnb_used) const; + const CCoinControl& coin_control, CoinSelectionParams& coin_selection_params, bool& bnb_used) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); /** Get a name for this wallet for logging/debugging purposes. */ @@ -1183,8 +1191,8 @@ public: CAmountMap GetChange(const CTransaction& tx) const; // ELEMENTS: - CAmountMap GetCredit(const CWalletTx& wtx, const isminefilter& filter) const; - CAmountMap GetChange(const CWalletTx& wtx) const; + CAmountMap GetCredit(const CWalletTx& wtx, const isminefilter& filter) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); + CAmountMap GetChange(const CWalletTx& wtx) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); void chainStateFlushed(const CBlockLocator& loc) override; @@ -1416,9 +1424,9 @@ public: // Pubkey accessor for GetBlindingKey CPubKey GetBlindingPubKey(const CScript& script) const; - bool LoadSpecificBlindingKey(const CScriptID& scriptid, const uint256& key); - bool AddSpecificBlindingKey(const CScriptID& scriptid, const uint256& key); - bool SetMasterBlindingKey(const uint256& key); + bool LoadSpecificBlindingKey(const CScriptID& scriptid, const uint256& key) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); + bool AddSpecificBlindingKey(const CScriptID& scriptid, const uint256& key) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); + bool SetMasterBlindingKey(const uint256& key) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); /// Returns a map of entropy to the respective pair of reissuance token and issuance asset. std::map > GetReissuanceTokenTypes() const;