22 int confirms =
wallet.GetTxDepthInMainChain(wtx);
23 entry.pushKV(
"confirmations", confirms);
25 entry.pushKV(
"generated",
true);
28 entry.pushKV(
"blockhash", conf->confirmed_block_hash.GetHex());
29 entry.pushKV(
"blockheight", conf->confirmed_block_height);
30 entry.pushKV(
"blockindex", conf->position_in_block);
33 entry.pushKV(
"blocktime", block_time);
38 entry.pushKV(
"txid", hash.
GetHex());
39 entry.pushKV(
"wtxid", wtx.GetWitnessHash().GetHex());
43 entry.pushKV(
"walletconflicts", std::move(conflicts));
45 for (
const Txid& mempool_conflict : wtx.mempool_conflicts)
47 entry.pushKV(
"mempoolconflicts", std::move(mempool_conflicts));
48 entry.pushKV(
"time", wtx.GetTxTime());
49 entry.pushKV(
"timereceived", int64_t{wtx.nTimeReceived});
52 std::string rbfStatus =
"no";
56 rbfStatus =
"unknown";
60 entry.pushKV(
"bip125-replaceable", rbfStatus);
62 for (
const std::pair<const std::string, std::string>& item : wtx.mapValue)
63 entry.pushKV(item.first, item.second);
69 int nConf{std::numeric_limits<int>::max()};
79 if (!params[0].isNull())
80 nMinDepth = params[0].getInt<
int>();
83 bool fIncludeEmpty =
false;
84 if (!params[1].isNull())
85 fIncludeEmpty = params[1].get_bool();
93 std::optional<CTxDestination> filtered_address{std::nullopt};
94 if (!by_label && !params[3].isNull() && !params[3].get_str().empty()) {
102 std::map<CTxDestination, tallyitem> mapTally;
103 for (
const std::pair<const uint256, CWalletTx>& pairWtx :
wallet.mapWallet) {
106 int nDepth =
wallet.GetTxDepthInMainChain(wtx);
107 if (nDepth < nMinDepth)
112 || (
wallet.IsTxImmatureCoinBase(wtx) && !include_immature_coinbase)) {
116 for (
const CTxOut& txout : wtx.
tx->vout) {
121 if (filtered_address && !(filtered_address == address)) {
126 if (!(mine & filter))
140 std::map<std::string, tallyitem> label_tally;
142 const auto& func = [&](
const CTxDestination& address,
const std::string& label,
bool is_change,
const std::optional<AddressPurpose>& purpose) {
143 if (is_change)
return;
145 auto it = mapTally.find(address);
146 if (it == mapTally.end() && !fIncludeEmpty)
150 int nConf = std::numeric_limits<int>::max();
151 bool fIsWatchonly =
false;
152 if (it != mapTally.end()) {
153 nAmount = (*it).second.nAmount;
154 nConf = (*it).second.nConf;
155 fIsWatchonly = (*it).second.fIsWatchonly;
165 if (fIsWatchonly) obj.
pushKV(
"involvesWatchonly",
true);
168 obj.
pushKV(
"confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf));
169 obj.
pushKV(
"label", label);
171 if (it != mapTally.end()) {
172 for (
const uint256& _item : (*it).second.txids) {
176 obj.
pushKV(
"txids", std::move(transactions));
177 ret.push_back(std::move(obj));
181 if (filtered_address) {
182 const auto& entry =
wallet.FindAddressBookEntry(*filtered_address,
false);
183 if (entry) func(*filtered_address, entry->GetLabel(), entry->IsChange(), entry->purpose);
186 wallet.ForEachAddrBookEntry(func);
190 for (
const auto& entry : label_tally) {
191 CAmount nAmount = entry.second.nAmount;
192 int nConf = entry.second.nConf;
194 if (entry.second.fIsWatchonly)
195 obj.
pushKV(
"involvesWatchonly",
true);
197 obj.
pushKV(
"confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf));
198 obj.
pushKV(
"label", entry.first);
199 ret.push_back(std::move(obj));
209 "\nList balances by receiving address.\n",
222 {
RPCResult::Type::BOOL,
"involvesWatchonly",
true,
"Only returns true if imported addresses were involved in transaction"},
225 {
RPCResult::Type::NUM,
"confirmations",
"The number of confirmations of the most recent transaction included"},
226 {
RPCResult::Type::STR,
"label",
"The label of the receiving address. The default label is \"\""},
237 +
HelpExampleCli(
"listreceivedbyaddress",
"6 true true \"\" true")
248 pwallet->BlockUntilSyncedToCurrentChain();
250 const bool include_immature_coinbase{request.params[4].isNull() ? false : request.params[4].get_bool()};
252 LOCK(pwallet->cs_wallet);
254 return ListReceived(*pwallet, request.params,
false, include_immature_coinbase);
262 "\nList received transactions by label.\n",
274 {
RPCResult::Type::BOOL,
"involvesWatchonly",
true,
"Only returns true if imported addresses were involved in transaction"},
276 {
RPCResult::Type::NUM,
"confirmations",
"The number of confirmations of the most recent transaction included"},
277 {
RPCResult::Type::STR,
"label",
"The label of the receiving address. The default label is \"\""},
293 pwallet->BlockUntilSyncedToCurrentChain();
295 const bool include_immature_coinbase{request.params[3].isNull() ? false : request.params[3].get_bool()};
297 LOCK(pwallet->cs_wallet);
299 return ListReceived(*pwallet, request.params,
true, include_immature_coinbase);
324 Vec&
ret,
const isminefilter& filter_ismine,
const std::optional<std::string>& filter_label,
325 bool include_change =
false)
329 std::list<COutputEntry> listReceived;
330 std::list<COutputEntry> listSent;
337 if (!filter_label.has_value())
343 entry.
pushKV(
"involvesWatchonly",
true);
346 entry.
pushKV(
"category",
"send");
348 const auto* address_book_entry =
wallet.FindAddressBookEntry(
s.destination);
349 if (address_book_entry) {
350 entry.
pushKV(
"label", address_book_entry->GetLabel());
357 ret.push_back(std::move(entry));
362 if (listReceived.size() > 0 &&
wallet.GetTxDepthInMainChain(wtx) >= nMinDepth) {
366 const auto* address_book_entry =
wallet.FindAddressBookEntry(r.destination);
367 if (address_book_entry) {
368 label = address_book_entry->GetLabel();
370 if (filter_label.has_value() && label != filter_label.value()) {
375 entry.
pushKV(
"involvesWatchonly",
true);
381 if (
wallet.GetTxDepthInMainChain(wtx) < 1)
382 entry.
pushKV(
"category",
"orphan");
383 else if (
wallet.IsTxImmatureCoinBase(wtx))
384 entry.
pushKV(
"category",
"immature");
386 entry.
pushKV(
"category",
"generate");
390 entry.
pushKV(
"category",
"receive");
393 if (address_book_entry) {
394 entry.
pushKV(
"label", label);
396 entry.
pushKV(
"vout", r.vout);
400 ret.push_back(std::move(entry));
408 return{{
RPCResult::Type::NUM,
"confirmations",
"The number of confirmations for the transaction. Negative confirmations means the\n"
409 "transaction conflicted that many blocks ago."},
410 {
RPCResult::Type::BOOL,
"generated",
true,
"Only present if the transaction's only input is a coinbase one."},
411 {
RPCResult::Type::BOOL,
"trusted",
true,
"Whether we consider the transaction to be trusted and safe to spend from.\n"
412 "Only present when the transaction has 0 confirmations (or negative confirmations, if conflicted)."},
415 {
RPCResult::Type::NUM,
"blockindex",
true,
"The index of the transaction in the block that includes it."},
419 {
RPCResult::Type::ARR,
"walletconflicts",
"Confirmed transactions that have been detected by the wallet to conflict with this transaction.",
423 {
RPCResult::Type::STR_HEX,
"replaced_by_txid",
true,
"Only if 'category' is 'send'. The txid if this tx was replaced."},
424 {
RPCResult::Type::STR_HEX,
"replaces_txid",
true,
"Only if 'category' is 'send'. The txid if this tx replaces another."},
425 {
RPCResult::Type::ARR,
"mempoolconflicts",
"Transactions in the mempool that directly conflict with either this transaction or an ancestor transaction",
432 {
RPCResult::Type::STR,
"comment",
true,
"If a comment is associated with the transaction, only present if not empty."},
433 {
RPCResult::Type::STR,
"bip125-replaceable",
"(\"yes|no|unknown\") Whether this transaction signals BIP125 replaceability or has an unconfirmed ancestor signaling BIP125 replaceability.\n"
434 "May be unknown for unconfirmed transactions not in the mempool because their unconfirmed ancestors are unknown."},
435 {
RPCResult::Type::ARR,
"parent_descs",
true,
"Only if 'category' is 'received'. List of parent descriptors for the output script of this coin.", {
444 "\nIf a label name is provided, this will return only incoming transactions paying to addresses with the specified label.\n"
445 "\nReturns up to 'count' most recent transactions skipping the first 'from' transactions.\n",
448 "with the specified label, or \"*\" to disable filtering and return all transactions."},
451 {
"include_watchonly",
RPCArg::Type::BOOL,
RPCArg::DefaultHint{
"true for watch-only wallets, otherwise false"},
"Include transactions to watch-only addresses (see 'importaddress')"},
458 {
RPCResult::Type::BOOL,
"involvesWatchonly",
true,
"Only returns true if imported addresses were involved in transaction."},
459 {
RPCResult::Type::STR,
"address",
true,
"The bitcoin address of the transaction (not returned if the output does not have an address, e.g. OP_RETURN null data)."},
461 "\"send\" Transactions sent.\n"
462 "\"receive\" Non-coinbase transactions received.\n"
463 "\"generate\" Coinbase transactions received with more than 100 confirmations.\n"
464 "\"immature\" Coinbase transactions received with 100 or fewer confirmations.\n"
465 "\"orphan\" Orphaned coinbase transactions received."},
467 "for all other categories"},
471 "'send' category of transactions."},
475 {
RPCResult::Type::BOOL,
"abandoned",
"'true' if the transaction has been abandoned (inputs are respendable)."},
480 "\nList the most recent 10 transactions in the systems\n"
482 "\nList transactions 100 to 120\n"
484 "\nAs a JSON-RPC call\n"
494 pwallet->BlockUntilSyncedToCurrentChain();
496 std::optional<std::string> filter_label;
497 if (!request.params[0].isNull() && request.params[0].get_str() !=
"*") {
499 if (filter_label.value().empty()) {
504 if (!request.params[1].isNull())
505 nCount = request.params[1].getInt<
int>();
507 if (!request.params[2].isNull())
508 nFrom = request.params[2].getInt<
int>();
520 std::vector<UniValue>
ret;
522 LOCK(pwallet->cs_wallet);
527 for (CWallet::TxItems::const_reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it)
531 if ((
int)
ret.size() >= (nCount+nFrom))
break;
537 if (nFrom > (
int)
ret.size())
539 if ((nFrom + nCount) > (
int)
ret.size())
540 nCount =
ret.size() - nFrom;
542 auto txs_rev_it{std::make_move_iterator(
ret.rend())};
544 result.push_backV(txs_rev_it - nFrom - nCount, txs_rev_it - nFrom);
553 "\nGet all transactions in blocks since block [blockhash], or all transactions if omitted.\n"
554 "If \"blockhash\" is no longer a part of the main chain, transactions from the fork point onward are included.\n"
555 "Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the \"removed\" array.\n",
558 {
"target_confirmations",
RPCArg::Type::NUM,
RPCArg::Default{1},
"Return the nth block hash from the main chain. e.g. 1 would mean the best block hash. Note: this is not used as a filter, but only affects [lastblock] in the return value"},
559 {
"include_watchonly",
RPCArg::Type::BOOL,
RPCArg::DefaultHint{
"true for watch-only wallets, otherwise false"},
"Include transactions to watch-only addresses (see 'importaddress')"},
561 "(not guaranteed to work on pruned nodes)"},
572 {
RPCResult::Type::BOOL,
"involvesWatchonly",
true,
"Only returns true if imported addresses were involved in transaction."},
573 {
RPCResult::Type::STR,
"address",
true,
"The bitcoin address of the transaction (not returned if the output does not have an address, e.g. OP_RETURN null data)."},
575 "\"send\" Transactions sent.\n"
576 "\"receive\" Non-coinbase transactions received.\n"
577 "\"generate\" Coinbase transactions received with more than 100 confirmations.\n"
578 "\"immature\" Coinbase transactions received with 100 or fewer confirmations.\n"
579 "\"orphan\" Orphaned coinbase transactions received."},
581 "for all other categories"},
584 "'send' category of transactions."},
588 {
RPCResult::Type::BOOL,
"abandoned",
"'true' if the transaction has been abandoned (inputs are respendable)."},
592 {
RPCResult::Type::ARR,
"removed",
true,
"<structure is the same as \"transactions\" above, only present if include_removed=true>\n"
593 "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."
595 {
RPCResult::Type::STR_HEX,
"lastblock",
"The hash of the block (target_confirmations-1) from the best block on the main chain, or the genesis hash if the referenced block does not exist yet. 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"},
600 +
HelpExampleCli(
"listsinceblock",
"\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\" 6")
601 +
HelpExampleRpc(
"listsinceblock",
"\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\", 6")
611 wallet.BlockUntilSyncedToCurrentChain();
615 std::optional<int> height;
616 std::optional<int> altheight;
617 int target_confirms = 1;
621 if (!request.params[0].isNull() && !request.params[0].get_str().empty()) {
622 blockId =
ParseHashV(request.params[0],
"blockhash");
630 if (!request.params[1].isNull()) {
631 target_confirms = request.params[1].getInt<
int>();
633 if (target_confirms < 1) {
642 bool include_removed = (request.params[3].isNull() || request.params[3].get_bool());
643 bool include_change = (!request.params[4].isNull() && request.params[4].get_bool());
646 std::optional<std::string> filter_label;
647 if (!request.params[5].isNull()) filter_label.emplace(
LabelFromValue(request.params[5]));
649 int depth = height ?
wallet.GetLastBlockHeight() + 1 - *height : -1;
653 for (
const std::pair<const uint256, CWalletTx>& pairWtx :
wallet.mapWallet) {
656 if (depth == -1 || abs(
wallet.GetTxDepthInMainChain(tx)) < depth) {
664 while (include_removed && altheight && *altheight > *height) {
670 auto it =
wallet.mapWallet.find(tx->GetHash());
671 if (it !=
wallet.mapWallet.end()) {
682 target_confirms = std::min(target_confirms,
wallet.GetLastBlockHeight() + 1);
686 ret.pushKV(
"transactions", std::move(transactions));
687 if (include_removed)
ret.pushKV(
"removed", std::move(removed));
688 ret.pushKV(
"lastblock", lastblock.
GetHex());
698 "\nGet detailed information about in-wallet transaction <txid>\n",
702 "Whether to include watch-only addresses in balance calculation and details[]"},
704 "Whether to include a `decoded` field containing the decoded transaction (equivalent to RPC decoderawtransaction)"},
711 "'send' category of transactions."},
719 {
RPCResult::Type::BOOL,
"involvesWatchonly",
true,
"Only returns true if imported addresses were involved in transaction."},
722 "\"send\" Transactions sent.\n"
723 "\"receive\" Non-coinbase transactions received.\n"
724 "\"generate\" Coinbase transactions received with more than 100 confirmations.\n"
725 "\"immature\" Coinbase transactions received with 100 or fewer confirmations.\n"
726 "\"orphan\" Orphaned coinbase transactions received."},
731 "'send' category of transactions."},
732 {
RPCResult::Type::BOOL,
"abandoned",
"'true' if the transaction has been abandoned (inputs are respendable)."},
733 {
RPCResult::Type::ARR,
"parent_descs",
true,
"Only if 'category' is 'received'. List of parent descriptors for the output script of this coin.", {
739 {
RPCResult::Type::OBJ,
"decoded",
true,
"The decoded transaction (only present when `verbose` is passed)",
741 {
RPCResult::Type::ELISION,
"",
"Equivalent to the RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed."},
747 HelpExampleCli(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
748 +
HelpExampleCli(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\" true")
749 +
HelpExampleCli(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\" false true")
750 +
HelpExampleRpc(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
759 pwallet->BlockUntilSyncedToCurrentChain();
761 LOCK(pwallet->cs_wallet);
771 bool verbose = request.params[2].isNull() ? false : request.params[2].get_bool();
774 auto it = pwallet->mapWallet.find(hash);
775 if (it == pwallet->mapWallet.end()) {
782 CAmount nNet = nCredit - nDebit;
793 entry.
pushKV(
"details", std::move(details));
800 entry.
pushKV(
"decoded", std::move(decoded));
812 "\nMark in-wallet transaction <txid> as abandoned\n"
813 "This will mark this transaction and all its in-wallet descendants as abandoned which will allow\n"
814 "for their inputs to be respent. It can be used to replace \"stuck\" or evicted transactions.\n"
815 "It only works on transactions which are not included in a block and are not currently in the mempool.\n"
816 "It has no effect on transactions which are already abandoned.\n",
822 HelpExampleCli(
"abandontransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
823 +
HelpExampleRpc(
"abandontransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
832 pwallet->BlockUntilSyncedToCurrentChain();
834 LOCK(pwallet->cs_wallet);
838 if (!pwallet->mapWallet.count(hash)) {
841 if (!pwallet->AbandonTransaction(hash)) {
853 "\nRescan the local blockchain for wallet related transactions.\n"
854 "Note: Use \"getwalletinfo\" to query the scanning progress.\n"
855 "The rescan is significantly faster when used on a descriptor wallet\n"
856 "and block filters are available (using startup option \"-blockfilterindex=1\").\n",
864 {
RPCResult::Type::NUM,
"start_height",
"The block height where the rescan started (the requested height or 0)"},
865 {
RPCResult::Type::NUM,
"stop_height",
"The height of the last rescanned block. May be null in rare cases if there was a reorg and the call didn't scan any blocks because they were already scanned in the background."},
880 wallet.BlockUntilSyncedToCurrentChain();
887 int start_height = 0;
888 std::optional<int> stop_height;
891 LOCK(pwallet->m_relock_mutex);
893 LOCK(pwallet->cs_wallet);
895 int tip_height = pwallet->GetLastBlockHeight();
897 if (!request.params[0].isNull()) {
898 start_height = request.params[0].getInt<
int>();
899 if (start_height < 0 || start_height > tip_height) {
904 if (!request.params[1].isNull()) {
905 stop_height = request.params[1].getInt<
int>();
906 if (*stop_height < 0 || *stop_height > tip_height) {
908 }
else if (*stop_height < start_height) {
914 if (!pwallet->chain().hasBlocks(pwallet->GetLastBlockHash(), start_height, stop_height)) {
915 if (pwallet->chain().havePruned() && pwallet->chain().getPruneHeight() >= start_height) {
916 throw JSONRPCError(
RPC_MISC_ERROR,
"Can't rescan beyond pruned data. Use RPC call getblockchaininfo to determine your pruned height.");
918 if (pwallet->chain().hasAssumedValidChain()) {
919 throw JSONRPCError(
RPC_MISC_ERROR,
"Failed to rescan unavailable blocks likely due to an in-progress assumeutxo background sync. Check logs or getchainstates RPC for assumeutxo background sync progress and try again later.");
921 throw JSONRPCError(
RPC_MISC_ERROR,
"Failed to rescan unavailable blocks, potentially caused by data corruption. If the issue persists you may want to reindex (see -reindex option).");
924 CHECK_NONFATAL(pwallet->chain().findAncestorByHeight(pwallet->GetLastBlockHash(), start_height,
FoundBlock().hash(start_block)));
928 pwallet->ScanForWalletTransactions(start_block, start_height, stop_height, reserver,
true,
false);
939 response.
pushKV(
"start_height", start_height);
949 "\nStops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call.\n"
950 "Note: Use \"getwalletinfo\" to query the scanning progress.\n",
954 "\nImport a private key\n"
956 "\nAbort the running wallet rescan\n"
958 "\nAs a JSON-RPC call\n"
966 if (!pwallet->IsScanning() || pwallet->IsAbortingRescan())
return false;
967 pwallet->AbortRescan();
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a scriptPubKey for the destination.
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination corresponds to one with an address.
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
int64_t CAmount
Amount in satoshis (Can be negative)
#define CHECK_NONFATAL(condition)
Identity function.
std::vector< CTransactionRef > vtx
An output of a transaction.
void push_back(UniValue val)
void pushKV(std::string key, UniValue val)
std::string GetHex() const
Interface giving clients (wallet processes, maybe other analysis tools in the future) ability to acce...
virtual RBFTransactionState isRBFOptIn(const CTransaction &tx)=0
Check if transaction is RBF opt in.
virtual bool findBlock(const uint256 &hash, const FoundBlock &block={})=0
Return whether node has the block and optionally return block metadata or contents.
Helper for findBlock to selectively return pieces of block data.
std::string GetHex() const
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
std::multimap< int64_t, CWalletTx * > TxItems
A transaction with a bunch of additional info that only the owner cares about.
const Txid & GetHash() const LIFETIMEBOUND
RAII object to check and reserve a wallet rescan.
bool reserve(bool with_passphrase=false)
std::string EncodeHexTx(const CTransaction &tx)
void TxToUniv(const CTransaction &tx, const uint256 &block_hash, UniValue &entry, bool include_hex=true, const CTxUndo *txundo=nullptr, TxVerbosity verbosity=TxVerbosity::SHOW_DETAILS)
UniValue ValueFromAmount(const CAmount amount)
const std::string CURRENCY_UNIT
bool IsValidDestinationString(const std::string &str, const CChainParams ¶ms)
CTxDestination DecodeDestination(const std::string &str, std::string &error_msg, std::vector< int > *error_locations)
std::string EncodeDestination(const CTxDestination &dest)
std::shared_ptr< CWallet > GetWalletForJSONRPCRequest(const JSONRPCRequest &request)
Figures out what wallet, if any, to use for a JSONRPCRequest.
RPCHelpMan listreceivedbyaddress()
static std::vector< RPCResult > TransactionDescriptionString()
static const RPCResult RESULT_LAST_PROCESSED_BLOCK
void EnsureWalletIsUnlocked(const CWallet &wallet)
bool CachedTxIsFromMe(const CWallet &wallet, const CWalletTx &wtx, const isminefilter &filter)
CAmount CachedTxGetDebit(const CWallet &wallet, const CWalletTx &wtx, const isminefilter &filter)
filter decides which addresses will count towards the debit
void CachedTxGetAmounts(const CWallet &wallet, const CWalletTx &wtx, std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, const isminefilter &filter, bool include_change)
void PushParentDescriptors(const CWallet &wallet, const CScript &script_pubkey, UniValue &entry)
Fetch parent descriptors of this scriptPubKey.
CAmount CachedTxGetCredit(const CWallet &wallet, const CWalletTx &wtx, const isminefilter &filter)
bool CachedTxIsTrusted(const CWallet &wallet, const CWalletTx &wtx, std::set< uint256 > &trusted_parents)
std::underlying_type< isminetype >::type isminefilter
used for bitflags of isminetype
RPCHelpMan abandontransaction()
RPCHelpMan listtransactions()
RPCHelpMan listsinceblock()
std::string LabelFromValue(const UniValue &value)
void AppendLastProcessedBlock(UniValue &entry, const CWallet &wallet)
static void ListTransactions(const CWallet &wallet, const CWalletTx &wtx, int nMinDepth, bool fLong, Vec &ret, const isminefilter &filter_ismine, const std::optional< std::string > &filter_label, bool include_change=false) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
List transactions based on the given criteria.
static UniValue ListReceived(const CWallet &wallet, const UniValue ¶ms, const bool by_label, const bool include_immature_coinbase) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
bool ParseIncludeWatchonly(const UniValue &include_watchonly, const CWallet &wallet)
Used by RPC commands that have an include_watchonly parameter.
RPCHelpMan gettransaction()
RPCHelpMan rescanblockchain()
static void WalletTxToJSON(const CWallet &wallet, const CWalletTx &wtx, UniValue &entry) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
RPCHelpMan listreceivedbylabel()
static void MaybePushAddress(UniValue &entry, const CTxDestination &dest)
RBFTransactionState
The rbf state of unconfirmed transactions.
@ UNKNOWN
Unconfirmed tx that does not signal rbf and is not in the mempool.
@ REPLACEABLE_BIP125
Either this tx or a mempool ancestor signals rbf.
std::shared_ptr< const CTransaction > CTransactionRef
UniValue JSONRPCError(int code, const std::string &message)
@ RPC_MISC_ERROR
General application defined errors.
@ RPC_INVALID_PARAMETER
Invalid, missing or duplicate parameter.
@ RPC_WALLET_ERROR
Wallet errors.
@ RPC_INVALID_ADDRESS_OR_KEY
Invalid address or key.
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
const std::string UNIX_EPOCH_TIME
String used to describe UNIX epoch time in documentation, factored out to a constant for consistency.
const std::string EXAMPLE_ADDRESS[2]
Example bech32 addresses for the RPCExamples help documentation.
uint256 ParseHashV(const UniValue &v, std::string_view name)
Utilities: convert hex-encoded Values (throws error if not hex).
@ STR_HEX
Special type that is a STR with only hex chars.
std::string DefaultHint
Hint for default value.
@ OMITTED
Optional argument for which the default value is omitted from help text for one of two reasons:
@ ELISION
Special type to denote elision (...)
@ NUM_TIME
Special numeric to denote unix epoch time.
@ STR_HEX
Special string with only hex chars.
@ STR_AMOUNT
Special string to represent a floating point amount.
std::optional< int > last_scanned_height
enum wallet::CWallet::ScanResult::@19 status
State of transaction confirmed in a block.
std::vector< uint256 > txids
#define EXCLUSIVE_LOCKS_REQUIRED(...)
V Cat(V v1, V &&v2)
Concatenate two vectors, moving elements.