Merge pull request #4792 from vijaydasmp/bp2007

Merge #16949,#15084,#17138,#16689,#15098, #15932
This commit is contained in:
PastaPastaPasta 2022-06-18 22:12:07 -07:00 committed by GitHub
commit 951398e8b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 143 additions and 131 deletions

View File

@ -141,7 +141,7 @@ $(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig
$(1)_config_env+=PATH=$(build_prefix)/bin:$(PATH) $(1)_config_env+=PATH=$(build_prefix)/bin:$(PATH)
$(1)_build_env+=PATH=$(build_prefix)/bin:$(PATH) $(1)_build_env+=PATH=$(build_prefix)/bin:$(PATH)
$(1)_stage_env+=PATH=$(build_prefix)/bin:$(PATH) $(1)_stage_env+=PATH=$(build_prefix)/bin:$(PATH)
$(1)_autoconf=./configure --host=$($($(1)_type)_host) --disable-dependency-tracking --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)" $(1)_autoconf=./configure --host=$($($(1)_type)_host) --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)"
ifneq ($($(1)_nm),) ifneq ($($(1)_nm),)
$(1)_autoconf += NM="$$($(1)_nm)" $(1)_autoconf += NM="$$($(1)_nm)"

View File

@ -7,7 +7,7 @@ $(package)_build_subdir=build_unix
$(package)_patches=clang_cxx_11.patch $(package)_patches=clang_cxx_11.patch
define $(package)_set_vars define $(package)_set_vars
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication $(package)_config_opts=--disable-shared --enable-cxx --disable-replication --enable-option-checking
$(package)_config_opts_mingw32=--enable-mingw $(package)_config_opts_mingw32=--enable-mingw
$(package)_config_opts_linux=--with-pic $(package)_config_opts_linux=--with-pic
$(package)_config_opts_android=--with-pic $(package)_config_opts_android=--with-pic

View File

@ -6,6 +6,7 @@ $(package)_sha256_hash=cbc9102f4a31a8dafd42d642e9a3aa31e79a0aedaa1f6efd2795ebc83
define $(package)_set_vars define $(package)_set_vars
$(package)_config_opts=--disable-shared --without-docbook --without-tests --without-examples $(package)_config_opts=--disable-shared --without-docbook --without-tests --without-examples
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_config_opts_linux=--with-pic $(package)_config_opts_linux=--with-pic
endef endef

View File

@ -8,6 +8,7 @@ $(package)_patches=remove_char_width_usage.patch gperf_header_regen.patch
define $(package)_set_vars define $(package)_set_vars
$(package)_config_opts=--disable-docs --disable-static --disable-libxml2 --disable-iconv $(package)_config_opts=--disable-docs --disable-static --disable-libxml2 --disable-iconv
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
endef endef
define $(package)_preprocess_cmds define $(package)_preprocess_cmds

View File

@ -6,6 +6,7 @@ $(package)_sha256_hash=3a3bb2c4e15ffb433f2032f50a5b5a92558206822e22bfe8cbe339af4
define $(package)_set_vars define $(package)_set_vars
$(package)_config_opts=--without-zlib --without-png --without-harfbuzz --without-bzip2 --disable-static $(package)_config_opts=--without-zlib --without-png --without-harfbuzz --without-bzip2 --disable-static
$(package)_config_opts += --enable-option-checking
$(package)_config_opts_linux=--with-pic $(package)_config_opts_linux=--with-pic
endef endef

View File

@ -9,6 +9,7 @@ $(package)_dependencies=xproto
# --disable-xthreads. It is currently enabled. # --disable-xthreads. It is currently enabled.
define $(package)_set_vars define $(package)_set_vars
$(package)_config_opts=--disable-shared --disable-lint-library --without-lint $(package)_config_opts=--disable-shared --disable-lint-library --without-lint
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_config_opts_linux=--with-pic $(package)_config_opts_linux=--with-pic
endef endef

View File

@ -17,6 +17,7 @@ endif
define $(package)_set_vars define $(package)_set_vars
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples $(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_config_opts_release=--disable-debug-mode $(package)_config_opts_release=--disable-debug-mode
$(package)_config_opts_linux=--with-pic $(package)_config_opts_linux=--with-pic
$(package)_config_opts_android=--with-pic $(package)_config_opts_android=--with-pic

View File

@ -7,6 +7,7 @@ $(package)_dependencies=xcb_proto libXau
define $(package)_set_vars define $(package)_set_vars
$(package)_config_opts=--disable-static --disable-build-docs --without-doxygen --without-launchd $(package)_config_opts=--disable-static --disable-build-docs --without-doxygen --without-launchd
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
# Because we pass -qt-xcb to Qt, it will compile in a set of xcb helper libraries and extensions, # Because we pass -qt-xcb to Qt, it will compile in a set of xcb helper libraries and extensions,
# so we skip building all of the extensions here. # so we skip building all of the extensions here.
# More info is available from: https://doc.qt.io/qt-5.9/linux-requirements.html # More info is available from: https://doc.qt.io/qt-5.9/linux-requirements.html

View File

@ -7,6 +7,7 @@ $(package)_sha256_hash=efe5188b1ddbcbf98763b819b146be6a90481aac30cfc8d858ab78a19
define $(package)_set_vars define $(package)_set_vars
$(package)_config_opts=--disable-shared --without-tools --without-tests --disable-sdltest $(package)_config_opts=--disable-shared --without-tools --without-tests --disable-sdltest
$(package)_config_opts += --disable-gprof --disable-gcov --disable-mudflap $(package)_config_opts += --disable-gprof --disable-gcov --disable-mudflap
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_config_opts_linux=--with-pic $(package)_config_opts_linux=--with-pic
$(package)_config_opts_android=--with-pic $(package)_config_opts_android=--with-pic
endef endef

View File

@ -6,6 +6,7 @@ $(package)_sha256_hash=636162c1759805a5a0114a369dffdeccb8af8c859ef6e1445f26a4e6e
define $(package)_set_vars define $(package)_set_vars
$(package)_config_opts=--without-fop --without-xmlto --without-xsltproc --disable-specs $(package)_config_opts=--without-fop --without-xmlto --without-xsltproc --disable-specs
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
endef endef
define $(package)_preprocess_cmds define $(package)_preprocess_cmds

View File

@ -5,9 +5,10 @@ $(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb $(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb
define $(package)_set_vars define $(package)_set_vars
$(package)_config_opts=--without-docs --disable-shared --disable-curve --disable-curve-keygen --disable-perf --disable-Werror --disable-drafts $(package)_config_opts=--without-docs --disable-shared --disable-curve --disable-curve-keygen --disable-perf
$(package)_config_opts += --without-libsodium --without-libgssapi_krb5 --without-pgm --without-norm --without-vmci $(package)_config_opts += --without-libsodium --without-libgssapi_krb5 --without-pgm --without-norm --without-vmci
$(package)_config_opts += --disable-libunwind --disable-radix-tree --without-gcov $(package)_config_opts += --disable-libunwind --disable-radix-tree --without-gcov --disable-dependency-tracking
$(package)_config_opts += --disable-Werror --disable-drafts --enable-option-checking
$(package)_config_opts_linux=--with-pic $(package)_config_opts_linux=--with-pic
$(package)_config_opts_android=--with-pic $(package)_config_opts_android=--with-pic
$(package)_cxxflags=-std=c++17 $(package)_cxxflags=-std=c++17

View File

@ -288,6 +288,11 @@ public:
{ {
::mempool.GetTransactionAncestry(txid, ancestors, descendants); ::mempool.GetTransactionAncestry(txid, ancestors, descendants);
} }
void getPackageLimits(unsigned int& limit_ancestor_count, unsigned int& limit_descendant_count) override
{
limit_ancestor_count = gArgs.GetArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT);
limit_descendant_count = gArgs.GetArg("-limitdescendantcount", DEFAULT_DESCENDANT_LIMIT);
}
bool checkChainLimits(const CTransactionRef& tx) override bool checkChainLimits(const CTransactionRef& tx) override
{ {
LockPoints lp; LockPoints lp;

View File

@ -156,6 +156,11 @@ public:
//! Calculate mempool ancestor and descendant counts for the given transaction. //! Calculate mempool ancestor and descendant counts for the given transaction.
virtual void getTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) = 0; virtual void getTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) = 0;
//! Get the node's package limits.
//! Currently only returns the ancestor and descendant count limits, but could be enhanced to
//! return more policy settings.
virtual void getPackageLimits(unsigned int& limit_ancestor_count, unsigned int& limit_descendant_count) = 0;
//! Check if transaction will pass the mempool's chain limits. //! Check if transaction will pass the mempool's chain limits.
virtual bool checkChainLimits(const CTransactionRef& tx) = 0; virtual bool checkChainLimits(const CTransactionRef& tx) = 0;

View File

@ -208,12 +208,12 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const NetworkStyle* networkStyle,
openOptionsDialogWithTab(OptionsDialog::TAB_NETWORK); openOptionsDialogWithTab(OptionsDialog::TAB_NETWORK);
}); });
modalOverlay = new ModalOverlay(this->centralWidget()); modalOverlay = new ModalOverlay(enableWallet, this->centralWidget());
connect(labelBlocksIcon, &GUIUtil::ClickableLabel::clicked, this, &BitcoinGUI::showModalOverlay);
connect(progressBar, &GUIUtil::ClickableProgressBar::clicked, this, &BitcoinGUI::showModalOverlay);
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
if(enableWallet) { if(enableWallet) {
connect(walletFrame, &WalletFrame::requestedSyncWarningInfo, this, &BitcoinGUI::showModalOverlay); connect(walletFrame, &WalletFrame::requestedSyncWarningInfo, this, &BitcoinGUI::showModalOverlay);
connect(labelBlocksIcon, &GUIUtil::ClickableLabel::clicked, this, &BitcoinGUI::showModalOverlay);
connect(progressBar, &GUIUtil::ClickableProgressBar::clicked, this, &BitcoinGUI::showModalOverlay);
} }
#endif #endif

View File

@ -12,7 +12,7 @@
#include <QResizeEvent> #include <QResizeEvent>
#include <QPropertyAnimation> #include <QPropertyAnimation>
ModalOverlay::ModalOverlay(QWidget *parent) : ModalOverlay::ModalOverlay(bool enable_wallet, QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::ModalOverlay), ui(new Ui::ModalOverlay),
bestHeaderHeight(0), bestHeaderHeight(0),
@ -43,6 +43,10 @@ foreverHidden(false)
setVisible(false); setVisible(false);
GUIUtil::updateFonts(); GUIUtil::updateFonts();
if (!enable_wallet) {
ui->infoText->setVisible(false);
ui->infoTextStrong->setText(tr("Dash Core is currently syncing. It will download headers and blocks from peers and validate them until reaching the tip of the block chain."));
}
} }
ModalOverlay::~ModalOverlay() ModalOverlay::~ModalOverlay()

View File

@ -21,7 +21,7 @@ class ModalOverlay : public QWidget
Q_OBJECT Q_OBJECT
public: public:
explicit ModalOverlay(QWidget *parent); explicit ModalOverlay(bool enable_wallet, QWidget *parent);
~ModalOverlay(); ~ModalOverlay();
public Q_SLOTS: public Q_SLOTS:

View File

@ -110,6 +110,10 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(interfaces::Wal
// Payment to self by default // Payment to self by default
sub.type = TransactionRecord::SendToSelf; sub.type = TransactionRecord::SendToSelf;
sub.strAddress = ""; sub.strAddress = "";
for (auto it = wtx.txout_address.begin(); it != wtx.txout_address.end(); ++it) {
if (it != wtx.txout_address.begin()) sub.strAddress += ", ";
sub.strAddress += EncodeDestination(*it);
}
if(mapValue["DS"] == "1") if(mapValue["DS"] == "1")
{ {

View File

@ -433,6 +433,7 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, b
case TransactionRecord::SendToOther: case TransactionRecord::SendToOther:
return QString::fromStdString(wtx->strAddress) + watchAddress; return QString::fromStdString(wtx->strAddress) + watchAddress;
case TransactionRecord::SendToSelf: case TransactionRecord::SendToSelf:
return formatAddressLabel(wtx->strAddress, wtx->label, tooltip) + watchAddress;
default: default:
return tr("(n/a)") + watchAddress; return tr("(n/a)") + watchAddress;
} }

View File

@ -124,6 +124,9 @@ static int ComputeNextBlockAndDepth(const CBlockIndex* tip, const CBlockIndex* b
UniValue blockheaderToJSON(const CBlockIndex* tip, const CBlockIndex* blockindex) UniValue blockheaderToJSON(const CBlockIndex* tip, const CBlockIndex* blockindex)
{ {
// Serialize passed information without accessing chain state of the active chain!
AssertLockNotHeld(cs_main); // For performance reasons
UniValue result(UniValue::VOBJ); UniValue result(UniValue::VOBJ);
result.pushKV("hash", blockindex->GetBlockHash().GetHex()); result.pushKV("hash", blockindex->GetBlockHash().GetHex());
const CBlockIndex* pnext; const CBlockIndex* pnext;
@ -153,6 +156,9 @@ UniValue blockheaderToJSON(const CBlockIndex* tip, const CBlockIndex* blockindex
UniValue blockToJSON(const CBlock& block, const CBlockIndex* tip, const CBlockIndex* blockindex, bool txDetails) UniValue blockToJSON(const CBlock& block, const CBlockIndex* tip, const CBlockIndex* blockindex, bool txDetails)
{ {
// Serialize passed information without accessing chain state of the active chain!
AssertLockNotHeld(cs_main); // For performance reasons
UniValue result(UniValue::VOBJ); UniValue result(UniValue::VOBJ);
result.pushKV("hash", blockindex->GetBlockHash().GetHex()); result.pushKV("hash", blockindex->GetBlockHash().GetHex());
const CBlockIndex* pnext; const CBlockIndex* pnext;
@ -904,12 +910,17 @@ static UniValue getblockheaders(const JSONRPCRequest& request)
}, },
}.Check(request); }.Check(request);
LOCK(cs_main);
std::string strHash = request.params[0].get_str(); std::string strHash = request.params[0].get_str();
uint256 hash(uint256S(strHash)); uint256 hash(uint256S(strHash));
const CBlockIndex* pblockindex = LookupBlockIndex(hash); const CBlockIndex* pblockindex;
const CBlockIndex* tip;
{
LOCK(cs_main);
pblockindex = LookupBlockIndex(hash);
tip = ::ChainActive().Tip();
}
if (!pblockindex) { if (!pblockindex) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found"); throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
} }
@ -943,7 +954,7 @@ static UniValue getblockheaders(const JSONRPCRequest& request)
for (; pblockindex; pblockindex = ::ChainActive().Next(pblockindex)) for (; pblockindex; pblockindex = ::ChainActive().Next(pblockindex))
{ {
arrHeaders.push_back(blockheaderToJSON(::ChainActive().Tip(), pblockindex)); arrHeaders.push_back(blockheaderToJSON(tip, pblockindex));
if (--nCount <= 0) if (--nCount <= 0)
break; break;
} }
@ -1120,8 +1131,6 @@ static UniValue getblock(const JSONRPCRequest& request)
}, },
}.Check(request); }.Check(request);
LOCK(cs_main);
std::string strHash = request.params[0].get_str(); std::string strHash = request.params[0].get_str();
uint256 hash(uint256S(strHash)); uint256 hash(uint256S(strHash));
@ -1133,12 +1142,20 @@ static UniValue getblock(const JSONRPCRequest& request)
verbosity = request.params[1].get_bool() ? 1 : 0; verbosity = request.params[1].get_bool() ? 1 : 0;
} }
const CBlockIndex* pblockindex = LookupBlockIndex(hash); CBlock block;
if (!pblockindex) { const CBlockIndex* pblockindex;
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found"); const CBlockIndex* tip;
} {
LOCK(cs_main);
pblockindex = LookupBlockIndex(hash);
tip = ::ChainActive().Tip();
const CBlock block = GetBlockChecked(pblockindex); if (!pblockindex) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
}
block = GetBlockChecked(pblockindex);
}
if (verbosity <= 0) if (verbosity <= 0)
{ {
@ -1148,7 +1165,7 @@ static UniValue getblock(const JSONRPCRequest& request)
return strHex; return strHex;
} }
return blockToJSON(block, ::ChainActive().Tip(), pblockindex, verbosity >= 2); return blockToJSON(block, tip, pblockindex, verbosity >= 2);
} }
static UniValue pruneblockchain(const JSONRPCRequest& request) static UniValue pruneblockchain(const JSONRPCRequest& request)

View File

@ -5,9 +5,13 @@
#ifndef BITCOIN_RPC_BLOCKCHAIN_H #ifndef BITCOIN_RPC_BLOCKCHAIN_H
#define BITCOIN_RPC_BLOCKCHAIN_H #define BITCOIN_RPC_BLOCKCHAIN_H
#include <vector>
#include <stdint.h>
#include <amount.h> #include <amount.h>
#include <sync.h>
#include <stdint.h>
#include <vector>
extern RecursiveMutex cs_main;
class CBlock; class CBlock;
class CBlockIndex; class CBlockIndex;
@ -33,7 +37,7 @@ double GetDifficulty(const CBlockIndex* blockindex);
void RPCNotifyBlockChange(bool ibd, const CBlockIndex *); void RPCNotifyBlockChange(bool ibd, const CBlockIndex *);
/** Block description to JSON */ /** Block description to JSON */
UniValue blockToJSON(const CBlock& block, const CBlockIndex* tip, const CBlockIndex* blockindex, bool txDetails = false); UniValue blockToJSON(const CBlock& block, const CBlockIndex* tip, const CBlockIndex* blockindex, bool txDetails = false) LOCKS_EXCLUDED(cs_main);
/** Mempool information to JSON */ /** Mempool information to JSON */
UniValue MempoolInfoToJSON(const CTxMemPool& pool); UniValue MempoolInfoToJSON(const CTxMemPool& pool);
@ -42,7 +46,7 @@ UniValue MempoolInfoToJSON(const CTxMemPool& pool);
UniValue MempoolToJSON(const CTxMemPool& pool, bool verbose = false); UniValue MempoolToJSON(const CTxMemPool& pool, bool verbose = false);
/** Block header to JSON */ /** Block header to JSON */
UniValue blockheaderToJSON(const CBlockIndex* tip, const CBlockIndex* blockindex); UniValue blockheaderToJSON(const CBlockIndex* tip, const CBlockIndex* blockindex) LOCKS_EXCLUDED(cs_main);
/** Used by getblockstats to get feerates at different percentiles by weight */ /** Used by getblockstats to get feerates at different percentiles by weight */
void CalculatePercentilesBySize(CAmount result[NUM_GETBLOCKSTATS_PERCENTILES], std::vector<std::pair<CAmount, int64_t>>& scores, int64_t total_size); void CalculatePercentilesBySize(CAmount result[NUM_GETBLOCKSTATS_PERCENTILES], std::vector<std::pair<CAmount, int64_t>>& scores, int64_t total_size);

View File

@ -135,8 +135,6 @@ bool WalletInit::ParameterInteraction() const
if (gArgs.GetBoolArg("-sysperms", false)) if (gArgs.GetBoolArg("-sysperms", false))
return InitError(Untranslated("-sysperms is not allowed in combination with enabled wallet functionality")); return InitError(Untranslated("-sysperms is not allowed in combination with enabled wallet functionality"));
if (gArgs.GetArg("-prune", 0) && gArgs.GetBoolArg("-rescan", false))
return InitError(_("Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again."));
if (gArgs.IsArgSet("-walletbackupsdir")) { if (gArgs.IsArgSet("-walletbackupsdir")) {
if (!fs::is_directory(gArgs.GetArg("-walletbackupsdir", ""))) { if (!fs::is_directory(gArgs.GetArg("-walletbackupsdir", ""))) {

View File

@ -1369,6 +1369,27 @@ static void ListTransactions(CWallet* const pwallet, const CWalletTx& wtx, int n
} }
} }
static const std::vector<RPCResult> TransactionDescriptionString()
{
return {{RPCResult::Type::NUM, "confirmations", "The number of blockchain confirmations for the transaction. Available for 'send' and\n"
"'receive' category of transactions. Negative confirmations indicate the\n"
"transaction conflicts with the block chain"},
{RPCResult::Type::BOOL, "instantlock", "Current transaction lock state. Available for 'send' and 'receive' category of transactions"},
{RPCResult::Type::BOOL, "instantlock-internal", "Current internal transaction lock state. Available for 'send' and 'receive' category of transactions"},
{RPCResult::Type::BOOL, "chainlock", "The state of the corresponding block chainlock"},
{RPCResult::Type::BOOL, "trusted", "Whether we consider the outputs of this unconfirmed transaction safe to spend."},
{RPCResult::Type::STR_HEX, "blockhash", "The block hash containing the transaction. Available for 'send' and 'receive'\n"
"category of transactions."},
{RPCResult::Type::NUM, "blockindex", "The index of the transaction in the block that includes it. Available for 'send' and 'receive'\n"
"category of transactions."},
{RPCResult::Type::NUM_TIME, "blocktime", "The block time expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::STR_HEX, "txid", "The transaction id. Available for 'send' and 'receive' category of transactions."},
{RPCResult::Type::NUM_TIME, "time", "The transaction time expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::NUM_TIME, "timereceived", "The time received expressed in " + UNIX_EPOCH_TIME + ". Available \n"
"for 'send' and 'receive' category of transactions."},
{RPCResult::Type::STR, "comment", "If a comment is associated with the transaction."}};
}
static UniValue listtransactions(const JSONRPCRequest& request) static UniValue listtransactions(const JSONRPCRequest& request)
{ {
RPCHelpMan{"listtransactions", RPCHelpMan{"listtransactions",
@ -1384,45 +1405,30 @@ static UniValue listtransactions(const JSONRPCRequest& request)
RPCResult{ RPCResult{
RPCResult::Type::ARR, "", "", RPCResult::Type::ARR, "", "",
{ {
{RPCResult::Type::OBJ, "", "", Cat<std::vector<RPCResult>>( {RPCResult::Type::OBJ, "", "", Cat(Cat<std::vector<RPCResult>>(
{ {
{RPCResult::Type::STR, "address", "The dash address of the transaction. Not present for\n" {RPCResult::Type::BOOL, "involvesWatchonly", "Only returns true if imported addresses were involved in transaction"},
"move transactions (category = move)."}, {RPCResult::Type::STR, "address", "The dash address of the transaction. Not present for\n"
{RPCResult::Type::STR, "category", "The transaction category.\n" "move transactions (category = move)."},
"\"send\" Transactions sent.\n" {RPCResult::Type::STR, "category", "The transaction category.\n"
"\"coinjoin\" Transactions sent using CoinJoin funds.\n" "\"send\" Transactions sent.\n"
"\"receive\" Non-coinbase transactions received.\n" "\"coinjoin\" Transactions sent using CoinJoin funds.\n"
"\"generate\" Coinbase transactions received with more than 100 confirmations.\n" "\"receive\" Non-coinbase transactions received.\n"
"\"immature\" Coinbase transactions received with 100 or fewer confirmations.\n" "\"generate\" Coinbase transactions received with more than 100 confirmations.\n"
"\"orphan\" Orphaned coinbase transactions received.\n"}, "\"immature\" Coinbase transactions received with 100 or fewer confirmations.\n"
{RPCResult::Type::STR_AMOUNT, "amount", "The amount in " + CURRENCY_UNIT + ". This is negative for the 'send' category, and is positive\n" "\"orphan\" Orphaned coinbase transactions received.\n"},
"for all other categories"}, {RPCResult::Type::STR_AMOUNT, "amount", "The amount in " + CURRENCY_UNIT + ". This is negative for the 'send' category, and is positive\n"
{RPCResult::Type::STR, "label", "A comment for the address/transaction, if any"}, "for all other categories"},
{RPCResult::Type::NUM, "vout", "the vout value"}, {RPCResult::Type::STR, "label", "A comment for the address/transaction, if any"},
{RPCResult::Type::STR_AMOUNT, "fee", "The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the\n" {RPCResult::Type::NUM, "vout", "the vout value"},
"'send' category of transactions."}, {RPCResult::Type::STR_AMOUNT, "fee", "The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the\n"
{RPCResult::Type::NUM, "confirmations", "The number of blockchain confirmations for the transaction. Available for 'send' and\n" "'send' category of transactions."},
"'receive' category of transactions. Negative confirmations indicate the\n" },
"transaction conflicts with the block chain"}, TransactionDescriptionString()),
{RPCResult::Type::BOOL, "instantlock", "Current transaction lock state. Available for 'send' and 'receive' category of transactions"}, {
{RPCResult::Type::BOOL, "instantlock-internal", "Current internal transaction lock state. Available for 'send' and 'receive' category of transactions"}, {RPCResult::Type::BOOL, "abandoned", "'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
{RPCResult::Type::BOOL, "chainlock", "The state of the corresponding block chainlock"}, "'send' category of transactions."},
{RPCResult::Type::BOOL, "trusted", "Whether we consider the outputs of this unconfirmed transaction safe to spend."}, })},
{RPCResult::Type::STR_HEX, "blockhash", "The block hash containing the transaction. Available for 'send' and 'receive'\n"
"category of transactions."},
{RPCResult::Type::NUM, "blockindex", "The index of the transaction in the block that includes it. Available for 'send' and 'receive'\n"
"category of transactions."},
{RPCResult::Type::NUM_TIME, "blocktime", "The block time expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::STR_HEX, "txid", "The transaction id. Available for 'send' and 'receive' category of transactions."},
{RPCResult::Type::NUM_TIME, "time", "The transaction time expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::NUM_TIME, "timereceived", "The time received expressed in " + UNIX_EPOCH_TIME + ". Available \n"
"for 'send' and 'receive' category of transactions."},
{RPCResult::Type::STR, "comment", "If a comment is associated with the transaction."},
},
{
{RPCResult::Type::BOOL, "abandoned", "'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
"'send' category of transactions."},
})},
} }
}, },
RPCExamples{ RPCExamples{
@ -1509,12 +1515,13 @@ static UniValue listsinceblock(const JSONRPCRequest& request)
" (not guaranteed to work on pruned nodes)"}, " (not guaranteed to work on pruned nodes)"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", Cat<std::vector<RPCResult>>( RPCResult::Type::OBJ, "", "",
{ {
{RPCResult::Type::ARR, "transactions", "", {RPCResult::Type::ARR, "transactions", "",
{ {
{RPCResult::Type::OBJ, "", "", Cat<std::vector<RPCResult>>( {RPCResult::Type::OBJ, "", "", Cat(Cat<std::vector<RPCResult>>(
{ {
{RPCResult::Type::BOOL, "involvesWatchonly", "Only returns true if imported addresses were involved in transaction"},
{RPCResult::Type::STR, "address", "The dash address of the transaction."}, {RPCResult::Type::STR, "address", "The dash address of the transaction."},
{RPCResult::Type::STR, "category", "The transaction category.\n" {RPCResult::Type::STR, "category", "The transaction category.\n"
"\"send\" Transactions sent.\n" "\"send\" Transactions sent.\n"
@ -1527,59 +1534,20 @@ static UniValue listsinceblock(const JSONRPCRequest& request)
"for all other categories"}, "for all other categories"},
{RPCResult::Type::NUM, "vout", "the vout value"}, {RPCResult::Type::NUM, "vout", "the vout value"},
{RPCResult::Type::NUM, "fee", "The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the 'send' category of transactions."}, {RPCResult::Type::NUM, "fee", "The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the 'send' category of transactions."},
{RPCResult::Type::NUM, "confirmations", "The number of confirmations for the transaction."}, },
{RPCResult::Type::BOOL, "instantlock", "Current transaction lock state. Available for 'send' and 'receive' category of transactions."}, TransactionDescriptionString()),
{RPCResult::Type::BOOL, "instantlock_internal", "Current internal transaction lock state. Available for 'send' and 'receive' category of transactions."}, {
{RPCResult::Type::BOOL, "chainlock", "The state of the corresponding block chainlock."},
{RPCResult::Type::STR_HEX, "blockhash", "The block hash containing the transaction."},
{RPCResult::Type::NUM, "blockindex", "The index of the transaction in the block that includes it."},
{RPCResult::Type::NUM_TIME, "blocktime", "The block time expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::STR_HEX, "txid", "The transaction id."},
{RPCResult::Type::NUM_TIME, "time", "The transaction time expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::NUM_TIME, "timereceived", "The time received expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::BOOL, "abandoned", "'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions."}, {RPCResult::Type::BOOL, "abandoned", "'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions."},
{RPCResult::Type::STR, "comment", "If a comment is associated with the transaction."}, {RPCResult::Type::STR, "comment", "If a comment is associated with the transaction."},
{RPCResult::Type::STR, "label", "A comment for the address/transaction, if any."}, {RPCResult::Type::STR, "label", "A comment for the address/transaction, if any."},
{RPCResult::Type::STR, "to", "If a comment to is associated with the transaction."}, {RPCResult::Type::STR, "to", "If a comment to is associated with the transaction."},
}, })},
{ }},
{RPCResult::Type::STR_HEX, "lastblockhash", "The hash of the block (target_confirmations-1) from the best block on the main chain. This is typically used to feed back into listsinceblock the next time you call it. So you would generally use a target_confirmations of say 6, so you will be continually re-notified of transactions until they've reached 6 confirmations plus any new ones."} {RPCResult::Type::ARR, "removed", "<structure is the same as \"transactions\" above, only present if include_removed=true>\n"
} "Note: transactions that were re-added in the active chain will appear as-is in this array, and may thus have a positive confirmation count."
)}, , {{RPCResult::Type::ELISION, "", ""},}},
}}}, {RPCResult::Type::STR_HEX, "lastblockhash", "The hash of the block (target_confirmations-1) from the best block on the main chain. This is typically used to feed back into listsinceblock the next time you call it. So you would generally use a target_confirmations of say 6, so you will be continually re-notified of transactions until they've reached 6 confirmations plus any new ones."}
{ }
{RPCResult::Type::ARR, "removed", "<structure is the same as \"transactions\" above, only present if include_removed=true>\n Note: transactions that were re-added in the active chain will appear as-is in this array, and may thus have a positive confirmation count.",
{
{RPCResult::Type::OBJ, "", "", Cat<std::vector<RPCResult>>(
{
{RPCResult::Type::STR, "address", "The dash address of the transaction. Not present for move transactions (category = move)."},
{RPCResult::Type::STR, "category", "The transaction category. 'send' has negative amounts, 'receive' has positive amounts."},
{RPCResult::Type::NUM, "amount", "The amount in " + CURRENCY_UNIT + ". This is negative for the 'send' category, and for the 'move' category for moves \n"
"outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds."},
{RPCResult::Type::NUM, "vout", "the vout value"},
{RPCResult::Type::NUM, "fee", "The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the 'send' category of transactions."},
{RPCResult::Type::NUM, "confirmations", "The number of blockchain confirmations for the transaction. Available for 'send' and 'receive' category of transactions.\n"
"When it's < 0, it means the transaction conflicted that many blocks ago."},
{RPCResult::Type::BOOL, "instantlock", "Current transaction lock state. Available for 'send' and 'receive' category of transactions."},
{RPCResult::Type::BOOL, "instantlock_internal", "Current internal transaction lock state. Available for 'send' and 'receive' category of transactions."},
{RPCResult::Type::BOOL, "chainlock", "The state of the corresponding block chainlock."},
{RPCResult::Type::STR_HEX, "blockhash", "The block hash containing the transaction. Available for 'send' and 'receive' category of transactions."},
{RPCResult::Type::NUM, "blockindex", "The index of the transaction in the block that includes it. Available for 'send' and 'receive' category of transactions."},
{RPCResult::Type::NUM_TIME, "blocktime", "The block time expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::STR_HEX, "txid", "The transaction id. Available for 'send' and 'receive' category of transactions."},
{RPCResult::Type::NUM_TIME, "time", "The transaction time expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::NUM_TIME, "timereceived", "The time received expressed in " + UNIX_EPOCH_TIME + ". Available for 'send' and 'receive' category of transactions."},
{RPCResult::Type::BOOL, "abandoned", "'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions."},
{RPCResult::Type::STR, "comment", "If a comment is associated with the transaction."},
{RPCResult::Type::STR, "label", "A comment for the address/transaction, if any."},
{RPCResult::Type::STR, "to", "If a comment to is associated with the transaction."},
},
{
{RPCResult::Type::STR_HEX, "lastblockhash", "The hash of the block (target_confirmations-1) from the best block on the main chain. This is typically used to feed back into listsinceblock the next time you call it. So you would generally use a target_confirmations of say 6, so you will be continually re-notified of transactions until they've reached 6 confirmations plus any new ones."}
}
)},
}}
})
}, },
RPCExamples{ RPCExamples{
HelpExampleCli("listsinceblock", "") HelpExampleCli("listsinceblock", "")
@ -1681,25 +1649,19 @@ static UniValue gettransaction(const JSONRPCRequest& request)
{"include_watchonly", RPCArg::Type::BOOL, /* default */ "false", "Whether to include watch-only addresses in balance calculation and details[]"}, {"include_watchonly", RPCArg::Type::BOOL, /* default */ "false", "Whether to include watch-only addresses in balance calculation and details[]"},
}, },
RPCResult{ RPCResult{
RPCResult::Type::OBJ, "", "", RPCResult::Type::OBJ, "", "", Cat(Cat<std::vector<RPCResult>>(
{ {
{RPCResult::Type::STR_AMOUNT, "amount", "The amount in " + CURRENCY_UNIT}, {RPCResult::Type::STR_AMOUNT, "amount", "The amount in " + CURRENCY_UNIT},
{RPCResult::Type::STR_AMOUNT, "fee", "The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the\n" {RPCResult::Type::STR_AMOUNT, "fee", "The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the\n"
"'send' category of transactions."}, "'send' category of transactions."},
{RPCResult::Type::BOOL, "instantlock", "Current transaction lock state."}, },
{RPCResult::Type::BOOL, "instantlock_internal", "Current internal transaction lock state."}, TransactionDescriptionString()),
{RPCResult::Type::BOOL, "chainlock", "The state of the corresponding block chainlock."}, {
{RPCResult::Type::NUM, "confirmations", "The number of blockchain confirmations."},
{RPCResult::Type::STR_HEX, "blockhash", "The block hash."},
{RPCResult::Type::NUM, "blockindex", "The index of the transaction in the block that includes it."},
{RPCResult::Type::NUM_TIME, "blocktime", "The time expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::STR_HEX, "txid", "The transaction id."},
{RPCResult::Type::NUM_TIME, "time", "The transaction time expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::NUM_TIME, "timereceived", "The time received expressed in " + UNIX_EPOCH_TIME + "."},
{RPCResult::Type::ARR, "details", "", {RPCResult::Type::ARR, "details", "",
{ {
{RPCResult::Type::OBJ, "", "", {RPCResult::Type::OBJ, "", "",
{ {
{RPCResult::Type::BOOL, "involvesWatchonly", "Only returns true if imported addresses were involved in transaction"},
{RPCResult::Type::STR, "address", "The dash address involved in the transaction."}, {RPCResult::Type::STR, "address", "The dash address involved in the transaction."},
{RPCResult::Type::STR, "category", "The transaction category.\n" {RPCResult::Type::STR, "category", "The transaction category.\n"
"\"send\" Transactions sent.\n" "\"send\" Transactions sent.\n"
@ -1718,7 +1680,7 @@ static UniValue gettransaction(const JSONRPCRequest& request)
}}, }},
}}, }},
{RPCResult::Type::STR_HEX, "hex", "Raw data for transaction"}, {RPCResult::Type::STR_HEX, "hex", "Raw data for transaction"},
}, }),
}, },
RPCExamples{ RPCExamples{
HelpExampleCli("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") HelpExampleCli("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")

View File

@ -3375,8 +3375,11 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
} }
std::vector<OutputGroup> groups = GroupOutputs(vCoins, !coin_control.m_avoid_partial_spends); std::vector<OutputGroup> groups = GroupOutputs(vCoins, !coin_control.m_avoid_partial_spends);
size_t max_ancestors = (size_t)std::max<int64_t>(1, gArgs.GetArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT)); unsigned int limit_ancestor_count;
size_t max_descendants = (size_t)std::max<int64_t>(1, gArgs.GetArg("-limitdescendantcount", DEFAULT_DESCENDANT_LIMIT)); unsigned int limit_descendant_count;
chain().getPackageLimits(limit_ancestor_count, limit_descendant_count);
size_t max_ancestors = (size_t)std::max<int64_t>(1, limit_ancestor_count);
size_t max_descendants = (size_t)std::max<int64_t>(1, limit_descendant_count);
bool fRejectLongChains = gArgs.GetBoolArg("-walletrejectlongchains", DEFAULT_WALLET_REJECT_LONG_CHAINS); bool fRejectLongChains = gArgs.GetBoolArg("-walletrejectlongchains", DEFAULT_WALLET_REJECT_LONG_CHAINS);
bool res = nTargetValue <= nValueFromPresetInputs || bool res = nTargetValue <= nValueFromPresetInputs ||