Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 2,666 Lines • ▼ Show 20 Lines | static UniValue listsinceblock(const Config &config, | ||||
// provided was in a deactivated chain. | // provided was in a deactivated chain. | ||||
const CBlockIndex *pindex = nullptr; | const CBlockIndex *pindex = nullptr; | ||||
// Block index of the specified block, even if it's in a deactivated chain. | // Block index of the specified block, even if it's in a deactivated chain. | ||||
const CBlockIndex *paltindex = nullptr; | const CBlockIndex *paltindex = nullptr; | ||||
int target_confirms = 1; | int target_confirms = 1; | ||||
isminefilter filter = ISMINE_SPENDABLE; | isminefilter filter = ISMINE_SPENDABLE; | ||||
if (!request.params[0].isNull() && !request.params[0].get_str().empty()) { | if (!request.params[0].isNull() && !request.params[0].get_str().empty()) { | ||||
uint256 blockId; | BlockHash blockId(uint256S(request.params[0].get_str())); | ||||
blockId.SetHex(request.params[0].get_str()); | |||||
paltindex = pindex = LookupBlockIndex(blockId); | paltindex = pindex = LookupBlockIndex(blockId); | ||||
if (!pindex) { | if (!pindex) { | ||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found"); | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found"); | ||||
} | } | ||||
if (chainActive[pindex->nHeight] != pindex) { | if (chainActive[pindex->nHeight] != pindex) { | ||||
// the block being asked for is a part of a deactivated chain; | // the block being asked for is a part of a deactivated chain; | ||||
// we don't want to depend on its perceived height in the block | // we don't want to depend on its perceived height in the block | ||||
// chain, we want to instead use the last common ancestor | // chain, we want to instead use the last common ancestor | ||||
▲ Show 20 Lines • Show All 2,774 Lines • Show Last 20 Lines |