Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions contrib/valgrind.supp
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,6 @@
fun:__wcsnlen_sse4_1
fun:wcsnrtombs
}
{
Suppress boost warning
Memcheck:Leak
fun:_Znwm
...
fun:_ZN5boost9unit_test9framework5state17execute_test_treeEmjPKNS2_23random_generator_helperE
fun:_ZN5boost9unit_test9framework3runEmb
fun:_ZN5boost9unit_test14unit_test_mainEPFbvEiPPc
fun:main
}
{
Suppress boost still reachable memory warning
Memcheck:Leak
Expand Down
2 changes: 1 addition & 1 deletion doc/zmq.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ The option to set the PUB socket's outbound message high water mark
-zmqpubrawgovernanceobjecthwm=n
-zmqpubrawinstantsenddoublespendhwm=n
-zmqpubrawrecoveredsighwm=n
-zmqpubsequencehwm=address
-zmqpubsequencehwm=n

The high water mark value must be an integer greater than or equal to 0.

Expand Down
2 changes: 1 addition & 1 deletion src/bench/coin_selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static void CoinSelection(benchmark::Bench& bench)
wallet::CoinsResult available_coins;
for (const auto& wtx : wtxs) {
const auto txout = wtx->tx->vout.at(0);
available_coins.legacy.emplace_back(COutPoint(wtx->GetHash(), 0), txout, /*depth=*/6 * 24, CalculateMaximumSignedInputSize(txout, &wallet, /*coin_control=*/nullptr), /*spendable=*/true, /*solvable=*/true, /*safe=*/true, wtx->GetTxTime(), /*from_me=*/true, /*fees=*/ 0);
available_coins.coins[OutputType::LEGACY].emplace_back(COutPoint(wtx->GetHash(), 0), txout, /*depth=*/6 * 24, CalculateMaximumSignedInputSize(txout, &wallet, /*coin_control=*/nullptr), /*spendable=*/true, /*solvable=*/true, /*safe=*/true, wtx->GetTxTime(), /*from_me=*/true, /*fees=*/ 0);
}
const CoinEligibilityFilter filter_standard(1, 6, 0);
FastRandomContext rand{};
Expand Down
2 changes: 1 addition & 1 deletion src/coinjoin/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ bool CCoinJoinClientSession::CreateCollateralTransaction(CMutableTransaction& tx
AssertLockHeld(m_wallet->cs_wallet);

CCoinControl coin_control(CoinType::ONLY_COINJOIN_COLLATERAL);
std::vector<COutput> vCoins{AvailableCoinsListUnspent(*m_wallet, &coin_control).all()};
std::vector<COutput> vCoins{AvailableCoinsListUnspent(*m_wallet, &coin_control).All()};
if (vCoins.empty()) {
strReason = strprintf("%s requires a collateral transaction and could not locate an acceptable input!", gCoinJoinName);
return false;
Expand Down
5 changes: 3 additions & 2 deletions src/outputtype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
static const std::string OUTPUT_TYPE_STRING_LEGACY = "legacy";
static const std::string OUTPUT_TYPE_STRING_UNKNOWN = "unknown";

const std::array<OutputType, 1> OUTPUT_TYPES = {OutputType::LEGACY};

bool ParseOutputType(const std::string& type, OutputType& output_type)
{
if (type == OUTPUT_TYPE_STRING_LEGACY) {
output_type = OutputType::LEGACY;
return true;
} else if (type == OUTPUT_TYPE_STRING_UNKNOWN) {
output_type = OutputType::UNKNOWN;
return true;
}
return false;
}
Expand Down
5 changes: 4 additions & 1 deletion src/outputtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ enum class OutputType {
UNKNOWN,
};

extern const std::array<OutputType, 1> OUTPUT_TYPES;
static constexpr auto OUTPUT_TYPES = std::array{
OutputType::LEGACY,
OutputType::UNKNOWN,
};

[[nodiscard]] bool ParseOutputType(const std::string& str, OutputType& output_type);
const std::string& FormatOutputType(OutputType type);
Expand Down
49 changes: 30 additions & 19 deletions src/qt/test/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <interfaces/init.h>
#include <interfaces/node.h>
#include <qt/bitcoin.h>
#include <qt/guiconstants.h>
#include <qt/test/apptests.h>
#include <qt/test/optiontests.h>
#include <qt/test/rpcnestedtests.h>
Expand All @@ -25,6 +26,7 @@
#include <QApplication>
#include <QDebug>
#include <QObject>
#include <QSettings>
#include <QTest>

#include <functional>
Expand Down Expand Up @@ -80,38 +82,47 @@ int main(int argc, char* argv[])
setenv("QT_QPA_PLATFORM", "minimal", 0 /* overwrite */);
#endif

BitcoinApplication app;
app.setApplicationName("Dash-Qt-test");
app.createNode(*init);

QCoreApplication::setOrganizationName(QAPP_ORG_NAME);
QCoreApplication::setApplicationName(QAPP_APP_NAME_DEFAULT "-test");

int num_test_failures{0};

AppTests app_tests(app);
num_test_failures += QTest::qExec(&app_tests);
{
BitcoinApplication app;
app.createNode(*init);

AppTests app_tests(app);
num_test_failures += QTest::qExec(&app_tests);

OptionTests options_tests(app.node());
num_test_failures += QTest::qExec(&options_tests);
OptionTests options_tests(app.node());
num_test_failures += QTest::qExec(&options_tests);

URITests test1;
num_test_failures += QTest::qExec(&test1);
URITests test1;
num_test_failures += QTest::qExec(&test1);

RPCNestedTests test3(app.node());
num_test_failures += QTest::qExec(&test3);
RPCNestedTests test3(app.node());
num_test_failures += QTest::qExec(&test3);

#ifdef ENABLE_WALLET
WalletTests test5(app.node());
num_test_failures += QTest::qExec(&test5);
WalletTests test5(app.node());
num_test_failures += QTest::qExec(&test5);

AddressBookTests test6(app.node());
num_test_failures += QTest::qExec(&test6);
AddressBookTests test6(app.node());
num_test_failures += QTest::qExec(&test6);
#endif
TrafficGraphDataTests test7;
num_test_failures += QTest::qExec(&test7);

if (num_test_failures) {
qWarning("\nFailed tests: %d\n", num_test_failures);
} else {
qDebug("\nAll tests passed.\n");
if (num_test_failures) {
qWarning("\nFailed tests: %d\n", num_test_failures);
} else {
qDebug("\nAll tests passed.\n");
}
}

QSettings settings;
settings.clear();

return num_test_failures;
}
2 changes: 1 addition & 1 deletion src/rpc/evo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ static void FundSpecialTx(CWallet& wallet, CMutableTransaction& tx, const Specia
coinControl.destChange = fundDest;
coinControl.fRequireAllInputs = false;

for (const auto& out : AvailableCoinsListUnspent(wallet).all()) {
for (const auto& out : AvailableCoinsListUnspent(wallet).All()) {
CTxDestination txDest;
if (ExtractDestination(out.txout.scriptPubKey, txDest) && txDest == fundDest) {
coinControl.Select(out.outpoint);
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/masternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static RPCHelpMan masternode_outputs()
CCoinControl coin_control(CoinType::ONLY_MASTERNODE_COLLATERAL);

UniValue outputsArr(UniValue::VARR);
for (const auto& out : WITH_LOCK(wallet->cs_wallet, return AvailableCoinsListUnspent(*wallet, &coin_control).all())) {
for (const auto& out : WITH_LOCK(wallet->cs_wallet, return AvailableCoinsListUnspent(*wallet, &coin_control).All())) {
outputsArr.push_back(out.outpoint.ToStringShort());
}

Expand Down
3 changes: 1 addition & 2 deletions src/test/versionbits_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <consensus/params.h>
#include <deploymentstatus.h>
#include <test/util/setup_common.h>
#include <validation.h>
#include <versionbits.h>

#include <boost/test/unit_test.hpp>
Expand Down Expand Up @@ -185,7 +184,7 @@ class VersionBitsTester
CBlockIndex* Tip() { return vpblock.empty() ? nullptr : vpblock.back(); }
};

BOOST_FIXTURE_TEST_SUITE(versionbits_tests, TestingSetup)
BOOST_FIXTURE_TEST_SUITE(versionbits_tests, BasicTestingSetup)

BOOST_AUTO_TEST_CASE(versionbits_test)
{
Expand Down
6 changes: 3 additions & 3 deletions src/wallet/coinjoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ bool CWallet::SelectTxDSInsByDenomination(int nDenom, CAmount nValueMax, std::ve
CAmount nValueTotal{0};
CCoinControl coin_control(CoinType::ONLY_READY_TO_MIX);
std::set<uint256> setRecentTxIds;
std::vector<COutput> vCoins{AvailableCoinsListUnspent(*this, &coin_control).all()};
std::vector<COutput> vCoins{AvailableCoinsListUnspent(*this, &coin_control).All()};

WalletCJLogPrint(this, "CWallet::%s -- vCoins.size(): %d\n", __func__, vCoins.size());

Expand Down Expand Up @@ -104,7 +104,7 @@ bool CWallet::SelectDenominatedAmounts(CAmount nValueMax, std::set<CAmount>& set
CAmount nValueTotal{0};
CCoinControl coin_control(CoinType::ONLY_READY_TO_MIX);
// CompareByPriority() cares about effective value, which is only calculable when supplied a feerate
std::vector<COutput> vCoins{AvailableCoins(*this, &coin_control, /*feerate=*/CFeeRate(0)).all()};
std::vector<COutput> vCoins{AvailableCoins(*this, &coin_control, /*feerate=*/CFeeRate(0)).All()};

// larger denoms first
std::sort(vCoins.rbegin(), vCoins.rend(), CompareByPriority());
Expand Down Expand Up @@ -235,7 +235,7 @@ bool CWallet::HasCollateralInputs(bool fOnlyConfirmed) const
CCoinControl coin_control(CoinType::ONLY_COINJOIN_COLLATERAL);
coin_control.m_include_unsafe_inputs = !fOnlyConfirmed;

return AvailableCoinsListUnspent(*this, &coin_control).size() > 0;
return AvailableCoinsListUnspent(*this, &coin_control).Size() > 0;
}

int CWallet::CountInputsWithAmount(CAmount nInputAmount) const
Expand Down
8 changes: 4 additions & 4 deletions src/wallet/rpc/backup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ RPCHelpMan importprivkey()
"\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n"
"may report that the imported key exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\n"
"The rescan parameter can be set to false if the key was never used to create transactions. If it is set to false,\n"
"but the key was used to create transactions, rescanwallet needs to be called with the appropriate block range.\n"
"but the key was used to create transactions, rescanblockchain needs to be called with the appropriate block range.\n"
"Note: This command is only compatible with legacy wallets. Use \"importdescriptors\" with \"combo(X)\" for descriptor wallets.\n",
{
{"privkey", RPCArg::Type::STR, RPCArg::Optional::NO, "The private key (see dumpprivkey)"},
Expand Down Expand Up @@ -211,7 +211,7 @@ RPCHelpMan importaddress()
"\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n"
"may report that the imported address exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\n"
"The rescan parameter can be set to false if the key was never used to create transactions. If it is set to false,\n"
"but the key was used to create transactions, rescanwallet needs to be called with the appropriate block range.\n"
"but the key was used to create transactions, rescanblockchain needs to be called with the appropriate block range.\n"
"If you have the full public key, you should call importpubkey instead of this.\n"
"Hint: use importmulti to import more than one address.\n"
"\nNote: If you import a non-standard raw script in hex form, outputs sending to it will be treated\n"
Expand Down Expand Up @@ -409,7 +409,7 @@ RPCHelpMan importpubkey()
"\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n"
"may report that the imported pubkey exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\n"
"The rescan parameter can be set to false if the key was never used to create transactions. If it is set to false,\n"
"but the key was used to create transactions, rescanwallet needs to be called with the appropriate block range.\n"
"but the key was used to create transactions, rescanblockchain needs to be called with the appropriate block range.\n"
"Note: This command is only compatible with legacy wallets. Use \"importdescriptors\" with \"combo(X)\" for descriptor wallets.\n",
{
{"pubkey", RPCArg::Type::STR, RPCArg::Optional::NO, "The hex-encoded public key"},
Expand Down Expand Up @@ -1482,7 +1482,7 @@ RPCHelpMan importmulti()
"If an address/script is imported without all of the private keys required to spend from that address, it will be watchonly. The 'watchonly' option must be set to true in this case or a warning will be returned.\n"
"Conversely, if all the private keys are provided and the address/script is spendable, the watchonly option must be set to false, or a warning will be returned.\n"
"The rescan parameter can be set to false if the key was never used to create transactions. If it is set to false,\n"
"but the key was used to create transactions, rescanwallet needs to be called with the appropriate block range.\n"
"but the key was used to create transactions, rescanblockchain needs to be called with the appropriate block range.\n"
"\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n"
"may report that the imported keys, addresses or scripts exists but related transactions are still missing.\n"
"Note: This command is only compatible with legacy wallets. Use \"importdescriptors\" for descriptor wallets.\n",
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/rpc/coins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ RPCHelpMan listunspent()
coinControl.m_include_unsafe_inputs = include_unsafe;

LOCK(pwallet->cs_wallet);
vecOutputs = AvailableCoinsListUnspent(*pwallet, &coinControl, nMinimumAmount, nMaximumAmount, nMinimumSumAmount, nMaximumCount).all();
vecOutputs = AvailableCoinsListUnspent(*pwallet, &coinControl, nMinimumAmount, nMaximumAmount, nMinimumSumAmount, nMaximumCount).All();
}

LOCK(pwallet->cs_wallet);
Expand Down
Loading
Loading