Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcdump.cpp
Show First 20 Lines • Show All 360 Lines • ▼ Show 20 Lines | UniValue importprunedfunds(const Config &config, | ||||
// valid block | // valid block | ||||
std::vector<uint256> vMatch; | std::vector<uint256> vMatch; | ||||
std::vector<unsigned int> vIndex; | std::vector<unsigned int> vIndex; | ||||
unsigned int txnIndex = 0; | unsigned int txnIndex = 0; | ||||
if (merkleBlock.txn.ExtractMatches(vMatch, vIndex) == | if (merkleBlock.txn.ExtractMatches(vMatch, vIndex) == | ||||
merkleBlock.header.hashMerkleRoot) { | merkleBlock.header.hashMerkleRoot) { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
const CBlockIndex *pindex = | |||||
if (!mapBlockIndex.count(merkleBlock.header.GetHash()) || | LookupBlockIndex(merkleBlock.header.GetHash()); | ||||
!chainActive.Contains( | if (!pindex || !chainActive.Contains(pindex)) { | ||||
mapBlockIndex[merkleBlock.header.GetHash()])) { | |||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | ||||
"Block not found in chain"); | "Block not found in chain"); | ||||
} | } | ||||
std::vector<uint256>::const_iterator it; | std::vector<uint256>::const_iterator it; | ||||
if ((it = std::find(vMatch.begin(), vMatch.end(), txid)) == | if ((it = std::find(vMatch.begin(), vMatch.end(), txid)) == | ||||
vMatch.end()) { | vMatch.end()) { | ||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | ||||
▲ Show 20 Lines • Show All 1,052 Lines • Show Last 20 Lines |