25 int confirms =
wallet.GetTxDepthInMainChain(wtx);
26 entry.pushKV(
"confirmations", confirms);
28 entry.pushKV(
"generated",
true);
31 entry.pushKV(
"blockhash", conf->confirmed_block_hash.GetHex());
32 entry.pushKV(
"blockheight", conf->confirmed_block_height);
33 entry.pushKV(
"blockindex", conf->position_in_block);
36 entry.pushKV(
"blocktime", block_time);
40 entry.pushKV(
"txid", wtx.GetHash().GetHex());
41 entry.pushKV(
"wtxid", wtx.GetWitnessHash().GetHex());
43 for (
const auto& [wtxid,
_] : wtx.GetTxs()) {
44 if (wtxid == wtx.GetWitnessHash())
continue;
45 alternate_wtxids.
push_back(wtxid.GetHex());
47 entry.pushKV(
"alternate_wtxids", alternate_wtxids);
49 for (
const Txid& conflict :
wallet.GetTxConflicts(wtx))
51 entry.pushKV(
"walletconflicts", std::move(conflicts));
53 for (
const Txid& mempool_conflict : wtx.mempool_conflicts)
55 entry.pushKV(
"mempoolconflicts", std::move(mempool_conflicts));
56 entry.pushKV(
"time", wtx.GetTxTime());
57 entry.pushKV(
"timereceived", wtx.nTimeReceived);
61 std::string rbfStatus =
"no";
65 rbfStatus =
"unknown";
69 entry.pushKV(
"bip125-replaceable", rbfStatus);
72 if (wtx.m_comment) entry.pushKV(
"comment", *wtx.m_comment);
73 if (wtx.m_comment_to) entry.pushKV(
"to", *wtx.m_comment_to);
74 if (wtx.m_replaces_txid) entry.pushKV(
"replaces_txid", wtx.m_replaces_txid->ToString());
75 if (wtx.m_replaced_by_txid) entry.pushKV(
"replaced_by_txid", wtx.m_replaced_by_txid->ToString());
81 int nConf{std::numeric_limits<int>::max()};
90 if (!params[0].isNull())
91 nMinDepth = params[0].getInt<
int>();
94 bool fIncludeEmpty =
false;
95 if (!params[1].isNull())
96 fIncludeEmpty = params[1].get_bool();
98 std::optional<CTxDestination> filtered_address{std::nullopt};
99 if (!by_label && !params[3].isNull() && !params[3].get_str().empty()) {
107 std::map<CTxDestination, tallyitem> mapTally;
108 for (
const auto& [
_, wtx] :
wallet.mapWallet) {
110 int nDepth =
wallet.GetTxDepthInMainChain(wtx);
111 if (nDepth < nMinDepth)
115 if ((wtx.IsCoinBase() && (nDepth < 1))
116 || (
wallet.IsTxImmatureCoinBase(wtx) && !include_immature_coinbase)) {
120 for (
const CTxOut& txout : wtx.GetTx()->vout) {
125 if (filtered_address && !(filtered_address == address)) {
129 if (!
wallet.IsMine(address))
135 item.
txids.push_back(wtx.GetHash());
141 std::map<std::string, tallyitem> label_tally;
143 const auto& func = [&](
const CTxDestination& address,
const std::string& label,
bool is_change,
145 if (is_change)
return;
149 auto it = mapTally.find(address);
150 if (it == mapTally.end()) {
151 if (!fIncludeEmpty)
return;
152 if (!
wallet.IsMine(address))
return;
156 int nConf = std::numeric_limits<int>::max();
157 if (it != mapTally.end()) {
158 nAmount = (*it).second.nAmount;
159 nConf = (*it).second.nConf;
170 obj.
pushKV(
"confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf));
171 obj.
pushKV(
"label", label);
173 if (it != mapTally.end()) {
174 for (
const Txid& _item : (*it).second.txids) {
178 obj.
pushKV(
"txids", std::move(transactions));
179 ret.push_back(std::move(obj));
183 if (filtered_address) {
184 const auto& entry =
wallet.FindAddressBookEntry(*filtered_address,
false);
185 if (entry) func(*filtered_address, entry->GetLabel(), entry->IsChange(), entry->purpose);
188 wallet.ForEachAddrBookEntry(func);
192 for (
const auto& entry : label_tally) {
193 CAmount nAmount = entry.second.nAmount;
194 int nConf = entry.second.nConf;
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 "listreceivedbyaddress",
210 "List balances by receiving address.\n",
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 "listreceivedbylabel",
263 "List received transactions by label.\n",
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);
323 Vec&
ret,
const std::optional<std::string>& filter_label,
324 bool include_change =
false)
328 std::list<COutputEntry> listReceived;
329 std::list<COutputEntry> listSent;
334 if (!filter_label.has_value())
340 entry.
pushKV(
"category",
"send");
342 const auto* address_book_entry =
wallet.FindAddressBookEntry(
s.destination);
343 if (address_book_entry) {
344 entry.
pushKV(
"label", address_book_entry->GetLabel());
351 ret.push_back(std::move(entry));
356 if (listReceived.size() > 0 &&
wallet.GetTxDepthInMainChain(wtx) >= nMinDepth) {
360 const auto* address_book_entry =
wallet.FindAddressBookEntry(r.destination);
361 if (address_book_entry) {
362 label = address_book_entry->GetLabel();
364 if (filter_label.has_value() && label != filter_label.value()) {
372 if (
wallet.GetTxDepthInMainChain(wtx) < 1)
373 entry.
pushKV(
"category",
"orphan");
374 else if (
wallet.IsTxImmatureCoinBase(wtx))
375 entry.
pushKV(
"category",
"immature");
377 entry.
pushKV(
"category",
"generate");
381 entry.
pushKV(
"category",
"receive");
384 if (address_book_entry) {
385 entry.
pushKV(
"label", label);
387 entry.
pushKV(
"vout", r.vout);
391 ret.push_back(std::move(entry));
399 return{{
RPCResult::Type::NUM,
"confirmations",
"The number of confirmations for the transaction. Negative confirmations means the\n"
400 "transaction conflicted that many blocks ago."},
401 {
RPCResult::Type::BOOL,
"generated",
true,
"Only present if the transaction's only input is a coinbase one."},
402 {
RPCResult::Type::BOOL,
"trusted",
true,
"Whether we consider the transaction to be trusted and safe to spend from.\n"
403 "Only present when the transaction has 0 confirmations (or negative confirmations, if conflicted)."},
406 {
RPCResult::Type::NUM,
"blockindex",
true,
"The index of the transaction in the block that includes it."},
410 {
RPCResult::Type::ARR,
"alternate_wtxids",
"The wtxids of transactions with different witness data but the same txid.",
414 {
RPCResult::Type::ARR,
"walletconflicts",
"Confirmed transactions that have been detected by the wallet to conflict with this transaction.",
418 {
RPCResult::Type::STR_HEX,
"replaced_by_txid",
true,
"Only if 'category' is 'send'. The txid if this tx was replaced."},
419 {
RPCResult::Type::STR_HEX,
"replaces_txid",
true,
"Only if 'category' is 'send'. The txid if this tx replaces another."},
420 {
RPCResult::Type::ARR,
"mempoolconflicts",
"Transactions in the mempool that directly conflict with either this transaction or an ancestor transaction",
427 {
RPCResult::Type::STR,
"comment",
true,
"If a comment is associated with the transaction, only present if not empty."},
428 {
RPCResult::Type::STR,
"bip125-replaceable",
true,
"(\"yes|no|unknown\") (DEPRECATED) Whether this transaction signals BIP125 replaceability or has an unconfirmed ancestor signaling BIP125 replaceability.\n"
429 "May be unknown for unconfirmed transactions not in the mempool because their unconfirmed ancestors are unknown."},
430 {
RPCResult::Type::ARR,
"parent_descs",
true,
"Only if 'category' is 'receive'. List of parent descriptors for the output script of this coin.", {
440 "If a label name is provided, this will return only incoming transactions paying to addresses with the specified label.\n"
441 "Returns up to 'count' most recent transactions ordered from oldest to newest while skipping the first number of \n"
442 "transactions specified in the 'skip' argument. A transaction can have multiple entries in this RPC response. \n"
443 "For instance, a wallet transaction that pays three addresses — one wallet-owned and two external — will produce \n"
444 "four entries. The payment to the wallet-owned address appears both as a send entry and as a receive entry. \n"
445 "As a result, the RPC response will contain one entry in the receive category and three entries in the send category.\n",
448 "with the specified label, or \"*\" to disable filtering and return all transactions."},
458 {
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)."},
460 "\"send\" Transactions sent.\n"
461 "\"receive\" Non-coinbase transactions received.\n"
462 "\"generate\" Coinbase transactions received with more than 100 confirmations.\n"
463 "\"immature\" Coinbase transactions received with 100 or fewer confirmations.\n"
464 "\"orphan\" Orphaned coinbase transactions received."},
466 "for all other categories"},
470 "'send' category of transactions."},
474 {
RPCResult::Type::BOOL,
"abandoned",
"'true' if the transaction has been abandoned (inputs are respendable)."},
479 "\nList the most recent 10 transactions in the systems\n"
481 "\nList transactions 100 to 120\n"
483 "\nAs a JSON-RPC call\n"
493 pwallet->BlockUntilSyncedToCurrentChain();
495 std::optional<std::string> filter_label;
496 if (!request.params[0].isNull() && request.params[0].get_str() !=
"*") {
498 if (filter_label.value().empty()) {
503 if (!request.params[1].isNull())
504 nCount = request.params[1].getInt<
int>();
506 if (!request.params[2].isNull())
507 nFrom = request.params[2].getInt<
int>();
514 std::vector<UniValue>
ret;
516 LOCK(pwallet->cs_wallet);
521 for (CWallet::TxItems::const_reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it)
525 if ((
int)
ret.size() >= (nCount+nFrom))
break;
531 if (nFrom > (
int)
ret.size())
533 if ((nFrom + nCount) > (
int)
ret.size())
534 nCount =
ret.size() - nFrom;
536 auto txs_rev_it{std::make_move_iterator(
ret.rend())};
538 result.push_backV(txs_rev_it - nFrom - nCount, txs_rev_it - nFrom);
546 return Cat<std::vector<RPCResult>>(
548 {
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)."},
550 "\"send\" Transactions sent.\n"
551 "\"receive\" Non-coinbase transactions received.\n"
552 "\"generate\" Coinbase transactions received with more than 100 confirmations.\n"
553 "\"immature\" Coinbase transactions received with 100 or fewer confirmations.\n"
554 "\"orphan\" Orphaned coinbase transactions received."},
556 "for all other categories"},
559 "'send' category of transactions."},
563 std::vector<RPCResult>{
564 {
RPCResult::Type::BOOL,
"abandoned",
"'true' if the transaction has been abandoned (inputs are respendable)."},
575 "Get all transactions in blocks since block [blockhash], or all transactions if omitted.\n"
576 "If \"blockhash\" is no longer a part of the main chain, transactions from the fork point onward are included.\n"
577 "Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the \"removed\" array.\n",
580 {
"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"},
583 "(not guaranteed to work on pruned nodes)"},
594 {
RPCResult::Type::ARR,
"removed",
true,
"<structure is the same as \"transactions\" above, only present if include_removed=true>\n"
595 "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.",
599 {
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"},
604 +
HelpExampleCli(
"listsinceblock",
"\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\" 6")
605 +
HelpExampleRpc(
"listsinceblock",
"\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\", 6")
615 wallet.BlockUntilSyncedToCurrentChain();
619 std::optional<int> height;
620 std::optional<int> altheight;
621 int target_confirms = 1;
624 if (!request.params[0].isNull() && !request.params[0].get_str().empty()) {
625 blockId =
ParseHashV(request.params[0],
"blockhash");
633 if (!request.params[1].isNull()) {
634 target_confirms = request.params[1].getInt<
int>();
636 if (target_confirms < 1) {
641 bool include_removed = (request.params[3].isNull() || request.params[3].get_bool());
642 bool include_change = (!request.params[4].isNull() && request.params[4].get_bool());
645 std::optional<std::string> filter_label;
646 if (!request.params[5].isNull()) filter_label.emplace(
LabelFromValue(request.params[5]));
648 int depth = height ?
wallet.GetLastBlockHeight() + 1 - *height : -1;
652 for (
const auto& [
_, tx] :
wallet.mapWallet) {
654 if (depth == -1 || abs(
wallet.GetTxDepthInMainChain(tx)) < depth) {
662 while (include_removed && altheight && *altheight > *height) {
668 auto it =
wallet.mapWallet.find(tx->GetHash());
669 if (it !=
wallet.mapWallet.end()) {
680 target_confirms = std::min(target_confirms,
wallet.GetLastBlockHeight() + 1);
684 ret.pushKV(
"transactions", std::move(transactions));
685 if (include_removed)
ret.pushKV(
"removed", std::move(removed));
686 ret.pushKV(
"lastblock", lastblock.
GetHex());
697 "Get detailed information about in-wallet transaction <txid>\n",
702 "Whether to include a `decoded` field containing the decoded transaction (equivalent to RPC decoderawtransaction)"},
709 "'send' category of transactions."},
719 "\"send\" Transactions sent.\n"
720 "\"receive\" Non-coinbase transactions received.\n"
721 "\"generate\" Coinbase transactions received with more than 100 confirmations.\n"
722 "\"immature\" Coinbase transactions received with 100 or fewer confirmations.\n"
723 "\"orphan\" Orphaned coinbase transactions received."},
728 "'send' category of transactions."},
729 {
RPCResult::Type::BOOL,
"abandoned",
"'true' if the transaction has been abandoned (inputs are respendable)."},
730 {
RPCResult::Type::ARR,
"parent_descs",
true,
"Only if 'category' is 'receive'. List of parent descriptors for the output script of this coin.", {
736 {
RPCResult::Type::OBJ,
"decoded",
true,
"The decoded transaction (only present when `verbose` is passed)",
738 TxDoc({.wallet =
true}),
744 HelpExampleCli(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
745 +
HelpExampleCli(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\" true")
746 +
HelpExampleCli(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\" false true")
747 +
HelpExampleRpc(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
756 pwallet->BlockUntilSyncedToCurrentChain();
758 LOCK(pwallet->cs_wallet);
762 bool verbose = request.params[2].isNull() ? false : request.params[2].get_bool();
765 auto it = pwallet->mapWallet.find(hash);
766 if (it == pwallet->mapWallet.end()) {
773 CAmount nNet = nCredit - nDebit;
784 entry.
pushKV(
"details", std::move(details));
797 AssertLockHeld(pwallet->cs_wallet);
798 return OutputIsChange(*pwallet, txout);
800 entry.
pushKV(
"decoded", std::move(decoded));
812 "abandontransaction",
813 "Mark in-wallet transaction <txid> as abandoned\n"
814 "This will mark this transaction and all its in-wallet descendants as abandoned which will allow\n"
815 "for their inputs to be respent. It can be used to replace \"stuck\" or evicted transactions.\n"
816 "It only works on transactions which are not included in a block and are not currently in the mempool.\n"
817 "It has no effect on transactions which are already abandoned.\n",
823 HelpExampleCli(
"abandontransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
824 +
HelpExampleRpc(
"abandontransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
833 pwallet->BlockUntilSyncedToCurrentChain();
835 LOCK(pwallet->cs_wallet);
839 if (!pwallet->mapWallet.contains(hash)) {
842 if (!pwallet->AbandonTransaction(hash)) {
855 "Rescan the local blockchain for wallet related transactions.\n"
856 "Note: Use \"getwalletinfo\" to query the scanning progress.\n"
857 "The rescan is significantly faster if block filters are available\n"
858 "(using startup option \"-blockfilterindex=1\").\n",
866 {
RPCResult::Type::NUM,
"start_height",
"The block height where the rescan started (the requested height or 0)"},
867 {
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."},
882 wallet.BlockUntilSyncedToCurrentChain();
889 int start_height = 0;
890 std::optional<int> stop_height;
893 LOCK(pwallet->m_relock_mutex);
895 LOCK(pwallet->cs_wallet);
897 int tip_height = pwallet->GetLastBlockHeight();
899 if (!request.params[0].isNull()) {
900 start_height = request.params[0].getInt<
int>();
901 if (start_height < 0 || start_height > tip_height) {
906 if (!request.params[1].isNull()) {
907 stop_height = request.params[1].getInt<
int>();
908 if (*stop_height < 0 || *stop_height > tip_height) {
910 }
else if (*stop_height < start_height) {
916 if (!pwallet->chain().hasBlocks(pwallet->GetLastBlockHash(), start_height, stop_height)) {
917 if (pwallet->chain().havePruned() && pwallet->chain().getPruneHeight() >= start_height) {
918 throw JSONRPCError(
RPC_MISC_ERROR,
"Can't rescan beyond pruned data. Use RPC call getblockchaininfo to determine your pruned height.");
920 if (pwallet->chain().hasAssumedValidChain()) {
921 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.");
923 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).");
926 CHECK_NONFATAL(pwallet->chain().findAncestorByHeight(pwallet->GetLastBlockHash(), start_height,
FoundBlock().hash(start_block)));
930 pwallet->Scanner().Scan(start_block, start_height, stop_height, reserver,
false);
940 response.
pushKV(
"start_height", start_height);
950 "Stops current wallet rescan triggered by an RPC call, e.g. by a rescanblockchain call.\n"
951 "Note: Use \"getwalletinfo\" to query the scanning progress.\n",
955 "\nImport a private key\n"
957 "\nAbort the running wallet rescan\n"
959 "\nAs a JSON-RPC call\n"
967 if (!pwallet->Scanner().IsScanning() || pwallet->Scanner().IsAborting())
return false;
968 pwallet->Scanner().Abort();
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 bool rpcEnableDeprecated(const std::string &method)=0
Check if deprecated RPC is enabled.
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
static transaction_identifier FromUint256(const uint256 &id)
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.
CTransactionRef GetTx() const
RAII object to check and reserve a wallet rescan.
bool reserve(bool with_passphrase=false)
static const PrecomputedData data
Precomputed COutPoint and CCoins values.
std::string EncodeHexTx(const CTransaction &tx)
void TxToUniv(const CTransaction &tx, const uint256 &block_hash, UniValue &entry, bool include_hex, const CTxUndo *txundo, TxVerbosity verbosity, std::function< bool(const CTxOut &)> is_change_func)
UniValue ValueFromAmount(const CAmount amount)
@ SHOW_DETAILS
Include TXID, inputs, outputs, and other common block's transaction information.
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)
RPCMethod abandontransaction()
RPCMethod gettransaction()
std::shared_ptr< CWallet > GetWalletForJSONRPCRequest(const JSONRPCRequest &request)
Figures out what wallet, if any, to use for a JSONRPCRequest.
static std::vector< RPCResult > TransactionDescriptionString()
bool CachedTxIsFromMe(const CWallet &wallet, const CWalletTx &wtx)
RPCMethod listsinceblock()
bool CachedTxIsTrusted(const CWallet &wallet, const CWalletTx &wtx, std::set< Txid > &trusted_parents)
const RPCResult RESULT_LAST_PROCESSED_BLOCK
void EnsureWalletIsUnlocked(const CWallet &wallet)
RPCMethod rescanblockchain()
RPCMethod listtransactions()
void PushParentDescriptors(const CWallet &wallet, const CScript &script_pubkey, UniValue &entry)
Fetch parent descriptors of this scriptPubKey.
static std::vector< RPCResult > ListSinceBlockTxFields()
RPCMethod listreceivedbyaddress()
std::string LabelFromValue(const UniValue &value)
CAmount CachedTxGetDebit(const CWallet &wallet, const CWalletTx &wtx, bool avoid_reuse)
void AppendLastProcessedBlock(UniValue &entry, const CWallet &wallet)
CAmount CachedTxGetCredit(const CWallet &wallet, const CWalletTx &wtx, bool avoid_reuse)
static UniValue ListReceived(const CWallet &wallet, const UniValue ¶ms, const bool by_label, const bool include_immature_coinbase) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
void CachedTxGetAmounts(const CWallet &wallet, const CWalletTx &wtx, std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, bool include_change)
static void ListTransactions(const CWallet &wallet, const CWalletTx &wtx, int nMinDepth, bool fLong, Vec &ret, const std::optional< std::string > &filter_label, bool include_change=false) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
List transactions based on the given criteria.
RPCMethod listreceivedbylabel()
static void WalletTxToJSON(const CWallet &wallet, const CWalletTx &wtx, UniValue &entry) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
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
std::vector< RPCResult > TxDoc(const TxDocOptions &opts)
Explain the UniValue "decoded" transaction object, may include extra fields if processed by wallet.
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.
@ OMITTED
Optional argument for which the default value is omitted from help text for one of two reasons:
@ 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.
enum wallet::ScanResult::@19 status
std::optional< int > last_scanned_height
State of transaction confirmed in a block.
std::vector< Txid > txids
#define EXCLUSIVE_LOCKS_REQUIRED(...)
consteval auto _(util::TranslatedLiteral str)
V Cat(V v1, V &&v2)
Concatenate two vectors, moving elements.