Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 1,799 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
"Note: transactions that were re-added in the active chain " | "Note: transactions that were re-added in the active chain " | ||||
"will appear as-is in this array, and may thus have a " | "will appear as-is in this array, and may thus have a " | ||||
"positive confirmation count.", | "positive confirmation count.", | ||||
{ | { | ||||
{RPCResult::Type::ELISION, "", ""}, | {RPCResult::Type::ELISION, "", ""}, | ||||
}}, | }}, | ||||
{RPCResult::Type::STR_HEX, "lastblock", | {RPCResult::Type::STR_HEX, "lastblock", | ||||
"The hash of the block (target_confirmations-1) from the best " | "The hash of the block (target_confirmations-1) from the best " | ||||
"block on the main chain. This is typically used to feed back " | "block on the main chain, or the genesis hash if the " | ||||
"into listsinceblock the next time you call it. So you would " | "referenced block does not exist yet. This is typically used " | ||||
"generally use a target_confirmations of say 6, so you will " | "to feed back into listsinceblock the next time you call it. " | ||||
"be continually re-notified of transactions until they've " | "So you would generally use a target_confirmations of say 6, " | ||||
"reached 6 confirmations plus any new ones"}, | "so you will be continually re-notified of transactions until " | ||||
"they've reached 6 confirmations plus any new ones"}, | |||||
}}, | }}, | ||||
RPCExamples{HelpExampleCli("listsinceblock", "") + | RPCExamples{HelpExampleCli("listsinceblock", "") + | ||||
HelpExampleCli("listsinceblock", | HelpExampleCli("listsinceblock", | ||||
"\"000000000000000bacf66f7497b7dc45ef753ee9a" | "\"000000000000000bacf66f7497b7dc45ef753ee9a" | ||||
"7d38571037cdb1a57f663ad\" 6") + | "7d38571037cdb1a57f663ad\" 6") + | ||||
HelpExampleRpc("listsinceblock", | HelpExampleRpc("listsinceblock", | ||||
"\"000000000000000bacf66f7497b7dc45ef753ee9a" | "\"000000000000000bacf66f7497b7dc45ef753ee9a" | ||||
"7d38571037cdb1a57f663ad\", 6")}, | "7d38571037cdb1a57f663ad\", 6")}, | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | while (include_removed && altheight && *altheight > *height) { | ||||
filter, nullptr /* filter_label */); | filter, nullptr /* filter_label */); | ||||
} | } | ||||
} | } | ||||
blockId = block.hashPrevBlock; | blockId = block.hashPrevBlock; | ||||
--*altheight; | --*altheight; | ||||
} | } | ||||
BlockHash lastblock; | BlockHash lastblock; | ||||
target_confirms = | |||||
std::min(target_confirms, wallet.GetLastBlockHeight() + 1); | |||||
CHECK_NONFATAL(wallet.chain().findAncestorByHeight( | CHECK_NONFATAL(wallet.chain().findAncestorByHeight( | ||||
wallet.GetLastBlockHash(), | wallet.GetLastBlockHash(), | ||||
wallet.GetLastBlockHeight() + 1 - target_confirms, | wallet.GetLastBlockHeight() + 1 - target_confirms, | ||||
FoundBlock().hash(lastblock))); | FoundBlock().hash(lastblock))); | ||||
UniValue ret(UniValue::VOBJ); | UniValue ret(UniValue::VOBJ); | ||||
ret.pushKV("transactions", transactions); | ret.pushKV("transactions", transactions); | ||||
if (include_removed) { | if (include_removed) { | ||||
▲ Show 20 Lines • Show All 3,051 Lines • Show Last 20 Lines |