Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 4,086 Lines • ▼ Show 20 Lines | if (fPruneMode) { | ||||
"Can't rescan beyond pruned data. Use RPC " | "Can't rescan beyond pruned data. Use RPC " | ||||
"call getblockchaininfo to determine your " | "call getblockchaininfo to determine your " | ||||
"pruned height."); | "pruned height."); | ||||
} | } | ||||
block = block->pprev; | block = block->pprev; | ||||
} | } | ||||
} | } | ||||
const CBlockIndex *stopBlock; | const CBlockIndex *failed_block, *stopBlock; | ||||
CWallet::ScanResult result = pwallet->ScanForWalletTransactions( | CWallet::ScanResult result = pwallet->ScanForWalletTransactions( | ||||
pindexStart, pindexStop, reserver, stopBlock, true); | pindexStart, pindexStop, reserver, failed_block, stopBlock, true); | ||||
switch (result) { | switch (result) { | ||||
case CWallet::ScanResult::SUCCESS: | case CWallet::ScanResult::SUCCESS: | ||||
stopBlock = pindexStop ? pindexStop : pChainTip; | // stopBlock set by ScanForWalletTransactions | ||||
break; | break; | ||||
case CWallet::ScanResult::FAILURE: | case CWallet::ScanResult::FAILURE: | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_MISC_ERROR, | RPC_MISC_ERROR, | ||||
"Rescan failed. Potentially corrupted data files."); | "Rescan failed. Potentially corrupted data files."); | ||||
case CWallet::ScanResult::USER_ABORT: | case CWallet::ScanResult::USER_ABORT: | ||||
throw JSONRPCError(RPC_MISC_ERROR, "Rescan aborted."); | throw JSONRPCError(RPC_MISC_ERROR, "Rescan aborted."); | ||||
// no default case, so the compiler can warn about missing cases | // no default case, so the compiler can warn about missing cases | ||||
▲ Show 20 Lines • Show All 888 Lines • Show Last 20 Lines |