21 int confirms =
wallet.GetTxDepthInMainChain(wtx);
22 entry.pushKV(
"confirmations", confirms);
24 entry.pushKV(
"generated",
true);
27 entry.pushKV(
"blockhash", conf->confirmed_block_hash.GetHex());
28 entry.pushKV(
"blockheight", conf->confirmed_block_height);
29 entry.pushKV(
"blockindex", conf->position_in_block);
32 entry.pushKV(
"blocktime", block_time);
37 entry.pushKV(
"txid", hash.
GetHex());
38 entry.pushKV(
"wtxid", wtx.GetWitnessHash().GetHex());
42 entry.pushKV(
"walletconflicts", conflicts);
43 entry.pushKV(
"time", wtx.GetTxTime());
44 entry.pushKV(
"timereceived", int64_t{wtx.nTimeReceived});
47 std::string rbfStatus =
"no";
51 rbfStatus =
"unknown";
55 entry.pushKV(
"bip125-replaceable", rbfStatus);
57 for (
const std::pair<const std::string, std::string>& item : wtx.mapValue)
58 entry.pushKV(item.first, item.second);
64 int nConf{std::numeric_limits<int>::max()};
74 if (!params[0].isNull())
75 nMinDepth = params[0].getInt<
int>();
78 bool fIncludeEmpty =
false;
79 if (!params[1].isNull())
80 fIncludeEmpty = params[1].get_bool();
88 std::optional<CTxDestination> filtered_address{std::nullopt};
89 if (!by_label && !params[3].isNull() && !params[3].get_str().empty()) {
97 std::map<CTxDestination, tallyitem> mapTally;
98 for (
const std::pair<const uint256, CWalletTx>& pairWtx :
wallet.mapWallet) {
101 int nDepth =
wallet.GetTxDepthInMainChain(wtx);
102 if (nDepth < nMinDepth)
107 || (
wallet.IsTxImmatureCoinBase(wtx) && !include_immature_coinbase)) {
111 for (
const CTxOut& txout : wtx.
tx->vout) {
116 if (filtered_address && !(filtered_address == address)) {
121 if (!(mine & filter))
135 std::map<std::string, tallyitem> label_tally;
137 const auto& func = [&](
const CTxDestination& address,
const std::string& label,
bool is_change,
const std::optional<AddressPurpose>& purpose) {
138 if (is_change)
return;
140 auto it = mapTally.find(address);
141 if (it == mapTally.end() && !fIncludeEmpty)
145 int nConf = std::numeric_limits<int>::max();
146 bool fIsWatchonly =
false;
147 if (it != mapTally.end()) {
148 nAmount = (*it).second.nAmount;
149 nConf = (*it).second.nConf;
150 fIsWatchonly = (*it).second.fIsWatchonly;
160 if (fIsWatchonly) obj.
pushKV(
"involvesWatchonly",
true);
163 obj.
pushKV(
"confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf));
164 obj.
pushKV(
"label", label);
166 if (it != mapTally.end()) {
167 for (
const uint256& _item : (*it).second.txids) {
171 obj.
pushKV(
"txids", transactions);
176 if (filtered_address) {
177 const auto& entry =
wallet.FindAddressBookEntry(*filtered_address,
false);
178 if (entry) func(*filtered_address, entry->GetLabel(), entry->IsChange(), entry->purpose);
181 wallet.ForEachAddrBookEntry(func);
185 for (
const auto& entry : label_tally) {
186 CAmount nAmount = entry.second.nAmount;
187 int nConf = entry.second.nConf;
189 if (entry.second.fIsWatchonly)
190 obj.
pushKV(
"involvesWatchonly",
true);
192 obj.
pushKV(
"confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf));
193 obj.
pushKV(
"label", entry.first);
204 "\nList balances by receiving address.\n",
217 {
RPCResult::Type::BOOL,
"involvesWatchonly",
true,
"Only returns true if imported addresses were involved in transaction"},
220 {
RPCResult::Type::NUM,
"confirmations",
"The number of confirmations of the most recent transaction included"},
221 {
RPCResult::Type::STR,
"label",
"The label of the receiving address. The default label is \"\""},
232 +
HelpExampleCli(
"listreceivedbyaddress",
"6 true true \"\" true")
243 pwallet->BlockUntilSyncedToCurrentChain();
245 const bool include_immature_coinbase{request.params[4].isNull() ? false : request.params[4].get_bool()};
247 LOCK(pwallet->cs_wallet);
249 return ListReceived(*pwallet, request.params,
false, include_immature_coinbase);
257 "\nList received transactions by label.\n",
269 {
RPCResult::Type::BOOL,
"involvesWatchonly",
true,
"Only returns true if imported addresses were involved in transaction"},
271 {
RPCResult::Type::NUM,
"confirmations",
"The number of confirmations of the most recent transaction included"},
272 {
RPCResult::Type::STR,
"label",
"The label of the receiving address. The default label is \"\""},
288 pwallet->BlockUntilSyncedToCurrentChain();
290 const bool include_immature_coinbase{request.params[3].isNull() ? false : request.params[3].get_bool()};
292 LOCK(pwallet->cs_wallet);
294 return ListReceived(*pwallet, request.params,
true, include_immature_coinbase);
319 Vec&
ret,
const isminefilter& filter_ismine,
const std::optional<std::string>& filter_label,
320 bool include_change =
false)
324 std::list<COutputEntry> listReceived;
325 std::list<COutputEntry> listSent;
332 if (!filter_label.has_value())
338 entry.
pushKV(
"involvesWatchonly",
true);
341 entry.
pushKV(
"category",
"send");
343 const auto* address_book_entry =
wallet.FindAddressBookEntry(s.destination);
344 if (address_book_entry) {
345 entry.
pushKV(
"label", address_book_entry->GetLabel());
347 entry.
pushKV(
"vout", s.vout);
352 ret.push_back(entry);
357 if (listReceived.size() > 0 &&
wallet.GetTxDepthInMainChain(wtx) >= nMinDepth) {
361 const auto* address_book_entry =
wallet.FindAddressBookEntry(r.destination);
362 if (address_book_entry) {
363 label = address_book_entry->GetLabel();
365 if (filter_label.has_value() && label != filter_label.value()) {
370 entry.
pushKV(
"involvesWatchonly",
true);
376 if (
wallet.GetTxDepthInMainChain(wtx) < 1)
377 entry.
pushKV(
"category",
"orphan");
378 else if (
wallet.IsTxImmatureCoinBase(wtx))
379 entry.
pushKV(
"category",
"immature");
381 entry.
pushKV(
"category",
"generate");
385 entry.
pushKV(
"category",
"receive");
388 if (address_book_entry) {
389 entry.
pushKV(
"label", label);
391 entry.
pushKV(
"vout", r.vout);
395 ret.push_back(entry);
403 return{{
RPCResult::Type::NUM,
"confirmations",
"The number of confirmations for the transaction. Negative confirmations means the\n" 404 "transaction conflicted that many blocks ago."},
405 {
RPCResult::Type::BOOL,
"generated",
true,
"Only present if the transaction's only input is a coinbase one."},
406 {
RPCResult::Type::BOOL,
"trusted",
true,
"Whether we consider the transaction to be trusted and safe to spend from.\n" 407 "Only present when the transaction has 0 confirmations (or negative confirmations, if conflicted)."},
410 {
RPCResult::Type::NUM,
"blockindex",
true,
"The index of the transaction in the block that includes it."},
423 {
RPCResult::Type::STR,
"comment",
true,
"If a comment is associated with the transaction, only present if not empty."},
424 {
RPCResult::Type::STR,
"bip125-replaceable",
"(\"yes|no|unknown\") Whether this transaction signals BIP125 replaceability or has an unconfirmed ancestor signaling BIP125 replaceability.\n" 425 "May be unknown for unconfirmed transactions not in the mempool because their unconfirmed ancestors are unknown."},
426 {
RPCResult::Type::ARR,
"parent_descs",
true,
"Only if 'category' is 'received'. List of parent descriptors for the scriptPubKey of this coin.", {
435 "\nIf a label name is provided, this will return only incoming transactions paying to addresses with the specified label.\n" 436 "\nReturns up to 'count' most recent transactions skipping the first 'from' transactions.\n",
439 "with the specified label, or \"*\" to disable filtering and return all transactions."},
442 {
"include_watchonly",
RPCArg::Type::BOOL,
RPCArg::DefaultHint{
"true for watch-only wallets, otherwise false"},
"Include transactions to watch-only addresses (see 'importaddress')"},
449 {
RPCResult::Type::BOOL,
"involvesWatchonly",
true,
"Only returns true if imported addresses were involved in transaction."},
450 {
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)."},
452 "\"send\" Transactions sent.\n" 453 "\"receive\" Non-coinbase transactions received.\n" 454 "\"generate\" Coinbase transactions received with more than 100 confirmations.\n" 455 "\"immature\" Coinbase transactions received with 100 or fewer confirmations.\n" 456 "\"orphan\" Orphaned coinbase transactions received."},
458 "for all other categories"},
462 "'send' category of transactions."},
466 {
RPCResult::Type::BOOL,
"abandoned",
"'true' if the transaction has been abandoned (inputs are respendable)."},
471 "\nList the most recent 10 transactions in the systems\n" 473 "\nList transactions 100 to 120\n" 475 "\nAs a JSON-RPC call\n" 485 pwallet->BlockUntilSyncedToCurrentChain();
487 std::optional<std::string> filter_label;
488 if (!request.params[0].isNull() && request.params[0].get_str() !=
"*") {
490 if (filter_label.value().empty()) {
495 if (!request.params[1].isNull())
496 nCount = request.params[1].getInt<
int>();
498 if (!request.params[2].isNull())
499 nFrom = request.params[2].getInt<
int>();
511 std::vector<UniValue>
ret;
513 LOCK(pwallet->cs_wallet);
518 for (CWallet::TxItems::const_reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it)
522 if ((
int)
ret.size() >= (nCount+nFrom))
break;
528 if (nFrom > (
int)
ret.size())
530 if ((nFrom + nCount) > (
int)
ret.size())
531 nCount =
ret.size() - nFrom;
533 auto txs_rev_it{std::make_move_iterator(
ret.rend())};
535 result.push_backV(txs_rev_it - nFrom - nCount, txs_rev_it - nFrom);
544 "\nGet all transactions in blocks since block [blockhash], or all transactions if omitted.\n" 545 "If \"blockhash\" is no longer a part of the main chain, transactions from the fork point onward are included.\n" 546 "Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the \"removed\" array.\n",
549 {
"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"},
550 {
"include_watchonly",
RPCArg::Type::BOOL,
RPCArg::DefaultHint{
"true for watch-only wallets, otherwise false"},
"Include transactions to watch-only addresses (see 'importaddress')"},
552 "(not guaranteed to work on pruned nodes)"},
563 {
RPCResult::Type::BOOL,
"involvesWatchonly",
true,
"Only returns true if imported addresses were involved in transaction."},
564 {
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)."},
566 "\"send\" Transactions sent.\n" 567 "\"receive\" Non-coinbase transactions received.\n" 568 "\"generate\" Coinbase transactions received with more than 100 confirmations.\n" 569 "\"immature\" Coinbase transactions received with 100 or fewer confirmations.\n" 570 "\"orphan\" Orphaned coinbase transactions received."},
572 "for all other categories"},
575 "'send' category of transactions."},
579 {
RPCResult::Type::BOOL,
"abandoned",
"'true' if the transaction has been abandoned (inputs are respendable)."},
583 {
RPCResult::Type::ARR,
"removed",
true,
"<structure is the same as \"transactions\" above, only present if include_removed=true>\n" 584 "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." 586 {
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"},
591 +
HelpExampleCli(
"listsinceblock",
"\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\" 6")
592 +
HelpExampleRpc(
"listsinceblock",
"\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\", 6")
602 wallet.BlockUntilSyncedToCurrentChain();
606 std::optional<int> height;
607 std::optional<int> altheight;
608 int target_confirms = 1;
612 if (!request.params[0].isNull() && !request.params[0].get_str().empty()) {
613 blockId =
ParseHashV(request.params[0],
"blockhash");
621 if (!request.params[1].isNull()) {
622 target_confirms = request.params[1].getInt<
int>();
624 if (target_confirms < 1) {
633 bool include_removed = (request.params[3].isNull() || request.params[3].get_bool());
634 bool include_change = (!request.params[4].isNull() && request.params[4].get_bool());
637 std::optional<std::string> filter_label;
638 if (!request.params[5].isNull()) filter_label.emplace(
LabelFromValue(request.params[5]));
640 int depth = height ?
wallet.GetLastBlockHeight() + 1 - *height : -1;
644 for (
const std::pair<const uint256, CWalletTx>& pairWtx :
wallet.mapWallet) {
647 if (depth == -1 || abs(
wallet.GetTxDepthInMainChain(tx)) < depth) {
655 while (include_removed && altheight && *altheight > *height) {
661 auto it =
wallet.mapWallet.find(tx->GetHash());
662 if (it !=
wallet.mapWallet.end()) {
673 target_confirms = std::min(target_confirms,
wallet.GetLastBlockHeight() + 1);
677 ret.pushKV(
"transactions", transactions);
678 if (include_removed)
ret.pushKV(
"removed", removed);
679 ret.pushKV(
"lastblock", lastblock.
GetHex());
689 "\nGet detailed information about in-wallet transaction <txid>\n",
693 "Whether to include watch-only addresses in balance calculation and details[]"},
695 "Whether to include a `decoded` field containing the decoded transaction (equivalent to RPC decoderawtransaction)"},
702 "'send' category of transactions."},
710 {
RPCResult::Type::BOOL,
"involvesWatchonly",
true,
"Only returns true if imported addresses were involved in transaction."},
713 "\"send\" Transactions sent.\n" 714 "\"receive\" Non-coinbase transactions received.\n" 715 "\"generate\" Coinbase transactions received with more than 100 confirmations.\n" 716 "\"immature\" Coinbase transactions received with 100 or fewer confirmations.\n" 717 "\"orphan\" Orphaned coinbase transactions received."},
722 "'send' category of transactions."},
723 {
RPCResult::Type::BOOL,
"abandoned",
"'true' if the transaction has been abandoned (inputs are respendable)."},
724 {
RPCResult::Type::ARR,
"parent_descs",
true,
"Only if 'category' is 'received'. List of parent descriptors for the scriptPubKey of this coin.", {
730 {
RPCResult::Type::OBJ,
"decoded",
true,
"The decoded transaction (only present when `verbose` is passed)",
732 {
RPCResult::Type::ELISION,
"",
"Equivalent to the RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed."},
738 HelpExampleCli(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
739 +
HelpExampleCli(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\" true")
740 +
HelpExampleCli(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\" false true")
741 +
HelpExampleRpc(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
750 pwallet->BlockUntilSyncedToCurrentChain();
752 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", details);
786 std::string strHex =
EncodeHexTx(*wtx.
tx, pwallet->chain().rpcSerializationFlags());
787 entry.
pushKV(
"hex", strHex);
792 entry.
pushKV(
"decoded", decoded);
804 "\nMark in-wallet transaction <txid> as abandoned\n" 805 "This will mark this transaction and all its in-wallet descendants as abandoned which will allow\n" 806 "for their inputs to be respent. It can be used to replace \"stuck\" or evicted transactions.\n" 807 "It only works on transactions which are not included in a block and are not currently in the mempool.\n" 808 "It has no effect on transactions which are already abandoned.\n",
814 HelpExampleCli(
"abandontransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
815 +
HelpExampleRpc(
"abandontransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
824 pwallet->BlockUntilSyncedToCurrentChain();
826 LOCK(pwallet->cs_wallet);
830 if (!pwallet->mapWallet.count(hash)) {
833 if (!pwallet->AbandonTransaction(hash)) {
845 "\nRescan the local blockchain for wallet related transactions.\n" 846 "Note: Use \"getwalletinfo\" to query the scanning progress.\n" 847 "The rescan is significantly faster when used on a descriptor wallet\n" 848 "and block filters are available (using startup option \"-blockfilterindex=1\").\n",
856 {
RPCResult::Type::NUM,
"start_height",
"The block height where the rescan started (the requested height or 0)"},
857 {
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."},
872 wallet.BlockUntilSyncedToCurrentChain();
879 int start_height = 0;
880 std::optional<int> stop_height;
883 LOCK(pwallet->m_relock_mutex);
885 LOCK(pwallet->cs_wallet);
887 int tip_height = pwallet->GetLastBlockHeight();
889 if (!request.params[0].isNull()) {
890 start_height = request.params[0].getInt<
int>();
891 if (start_height < 0 || start_height > tip_height) {
896 if (!request.params[1].isNull()) {
897 stop_height = request.params[1].getInt<
int>();
898 if (*stop_height < 0 || *stop_height > tip_height) {
900 }
else if (*stop_height < start_height) {
906 if (!pwallet->chain().hasBlocks(pwallet->GetLastBlockHash(), start_height, stop_height)) {
907 throw JSONRPCError(
RPC_MISC_ERROR,
"Can't rescan beyond pruned data. Use RPC call getblockchaininfo to determine your pruned height.");
914 pwallet->ScanForWalletTransactions(start_block, start_height, stop_height, reserver,
true,
false);
925 response.
pushKV(
"start_height", start_height);
935 "\nStops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call.\n" 936 "Note: Use \"getwalletinfo\" to query the scanning progress.\n",
940 "\nImport a private key\n" 942 "\nAbort the running wallet rescan\n" 944 "\nAs a JSON-RPC call\n" 952 if (!pwallet->IsScanning() || pwallet->IsAbortingRescan())
return false;
953 pwallet->AbortRescan();
std::shared_ptr< const CTransaction > CTransactionRef
Helper for findBlock to selectively return pieces of block data.
enum wallet::CWallet::ScanResult::@17 status
void push_back(UniValue val)
static void WalletTxToJSON(const CWallet &wallet, const CWalletTx &wtx, UniValue &entry) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination corresponds to one with an address.
std::optional< int > last_scanned_height
Either this tx or a mempool ancestor signals rbf.
bool IsValidDestinationString(const std::string &str, const CChainParams ¶ms)
Unconfirmed tx that does not signal rbf and is not in the mempool.
RPCHelpMan listtransactions()
RPCHelpMan abandontransaction()
#define CHECK_NONFATAL(condition)
Identity function.
bool ParseIncludeWatchonly(const UniValue &include_watchonly, const CWallet &wallet)
Used by RPC commands that have an include_watchonly parameter.
const std::string EXAMPLE_ADDRESS[2]
Example bech32 addresses for the RPCExamples help documentation.
RAII object to check and reserve a wallet rescan.
std::multimap< int64_t, CWalletTx * > TxItems
static const RPCResult RESULT_LAST_PROCESSED_BLOCK
bool reserve(bool with_passphrase=false)
State of transaction confirmed in a block.
static UniValue ListReceived(const CWallet &wallet, const UniValue ¶ms, const bool by_label, const bool include_immature_coinbase) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
Invalid, missing or duplicate parameter.
RBFTransactionState
The rbf state of unconfirmed transactions.
RPCHelpMan rescanblockchain()
void CachedTxGetAmounts(const CWallet &wallet, const CWalletTx &wtx, std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, const isminefilter &filter, bool include_change)
int64_t CAmount
Amount in satoshis (Can be negative)
A transaction with a bunch of additional info that only the owner cares about.
std::vector< uint256 > txids
Special type that is a STR with only hex chars.
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
std::underlying_type< isminetype >::type isminefilter
used for bitflags of isminetype
CAmount CachedTxGetCredit(const CWallet &wallet, const CWalletTx &wtx, const isminefilter &filter)
UniValue JSONRPCError(int code, const std::string &message)
Special string with only hex chars.
std::string LabelFromValue(const UniValue &value)
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a scriptPubKey for the destination.
RPCHelpMan listsinceblock()
bool CachedTxIsTrusted(const CWallet &wallet, const CWalletTx &wtx, std::set< uint256 > &trusted_parents)
RPCHelpMan listreceivedbylabel()
virtual bool findBlock(const uint256 &hash, const FoundBlock &block={})=0
Return whether node has the block and optionally return block metadata or contents.
const std::string CURRENCY_UNIT
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
General application defined errors.
std::string DefaultHint
Hint for default value.
static std::vector< RPCResult > TransactionDescriptionString()
An output of a transaction.
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
Special numeric to denote unix epoch time.
RPCHelpMan listreceivedbyaddress()
uint256 ParseHashV(const UniValue &v, std::string strName)
Utilities: convert hex-encoded Values (throws error if not hex).
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
Optional argument for which the default value is omitted from help text for one of two reasons: ...
#define EXCLUSIVE_LOCKS_REQUIRED(...)
std::vector< CTransactionRef > vtx
Special string to represent a floating point amount.
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.
Interface giving clients (wallet processes, maybe other analysis tools in the future) ability to acce...
void AppendLastProcessedBlock(UniValue &entry, const CWallet &wallet) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
void pushKV(std::string key, UniValue val)
RPCHelpMan gettransaction()
const uint256 & GetHash() const
std::string GetHex() const
UniValue ValueFromAmount(const CAmount amount)
std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags=0)
FoundBlock & hash(uint256 &hash)
virtual RBFTransactionState isRBFOptIn(const CTransaction &tx)=0
Check if transaction is RBF opt in.
void EnsureWalletIsUnlocked(const CWallet &wallet)
static void MaybePushAddress(UniValue &entry, const CTxDestination &dest)
std::string EncodeDestination(const CTxDestination &dest)
FoundBlock & height(int &height)
CTxDestination DecodeDestination(const std::string &str, std::string &error_msg, std::vector< int > *error_locations)
void PushParentDescriptors(const CWallet &wallet, const CScript &script_pubkey, UniValue &entry)
Fetch parent descriptors of this scriptPubKey.
void TxToUniv(const CTransaction &tx, const uint256 &block_hash, UniValue &entry, bool include_hex=true, int serialize_flags=0, const CTxUndo *txundo=nullptr, TxVerbosity verbosity=TxVerbosity::SHOW_DETAILS)
bool CachedTxIsFromMe(const CWallet &wallet, const CWalletTx &wtx, const isminefilter &filter)
std::shared_ptr< CWallet > GetWalletForJSONRPCRequest(const JSONRPCRequest &request)
Figures out what wallet, if any, to use for a JSONRPCRequest.
const std::string UNIX_EPOCH_TIME
String used to describe UNIX epoch time in documentation, factored out to a constant for consistency...
Special type to denote elision (...)
V Cat(V v1, V &&v2)
Concatenate two vectors, moving elements.
CAmount CachedTxGetDebit(const CWallet &wallet, const CWalletTx &wtx, const isminefilter &filter)
filter decides which addresses will count towards the debit