2024-06-26 20:19:26 +02:00
|
|
|
// Copyright (c) 2016 BitPay, Inc.
|
|
|
|
// Copyright (c) 2024 The Dash Core developers
|
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#ifndef BITCOIN_RPC_INDEX_UTIL_H
|
|
|
|
#define BITCOIN_RPC_INDEX_UTIL_H
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <amount.h>
|
2024-06-26 21:09:14 +02:00
|
|
|
#include <addressindex.h>
|
|
|
|
#include <spentindex.h>
|
2024-06-28 10:17:05 +02:00
|
|
|
#include <sync.h>
|
|
|
|
#include <threadsafety.h>
|
2024-06-26 20:19:26 +02:00
|
|
|
|
2024-06-28 10:17:05 +02:00
|
|
|
class CBlockTreeDB;
|
2024-06-26 20:19:26 +02:00
|
|
|
class CTxMemPool;
|
|
|
|
class uint160;
|
|
|
|
class uint256;
|
|
|
|
|
|
|
|
enum class AddressType : uint8_t;
|
|
|
|
|
2024-06-28 10:17:05 +02:00
|
|
|
extern RecursiveMutex cs_main;
|
|
|
|
|
|
|
|
bool GetAddressIndex(CBlockTreeDB& block_tree_db, const uint160& addressHash, const AddressType type,
|
2024-06-26 21:09:14 +02:00
|
|
|
std::vector<CAddressIndexEntry>& addressIndex,
|
2024-06-28 10:17:05 +02:00
|
|
|
const int32_t start = 0, const int32_t end = 0)
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
|
|
|
bool GetAddressUnspentIndex(CBlockTreeDB& block_tree_db, const uint160& addressHash, const AddressType type,
|
|
|
|
std::vector<CAddressUnspentIndexEntry>& unspentOutputs)
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
2024-06-26 21:24:21 +02:00
|
|
|
bool GetMempoolAddressDeltaIndex(const CTxMemPool& mempool,
|
|
|
|
const std::vector<CMempoolAddressDeltaKey>& addressDeltaIndex,
|
|
|
|
std::vector<CMempoolAddressDeltaEntry>& addressDeltaEntries);
|
2024-06-28 10:17:05 +02:00
|
|
|
bool GetSpentIndex(CBlockTreeDB& block_tree_db, const CTxMemPool& mempool, const CSpentIndexKey& key,
|
|
|
|
CSpentIndexValue& value)
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
|
|
|
bool GetTimestampIndex(CBlockTreeDB& block_tree_db, const uint32_t high, const uint32_t low,
|
|
|
|
std::vector<uint256>& hashes)
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
2024-06-26 20:19:26 +02:00
|
|
|
|
|
|
|
#endif // BITCOIN_RPC_CLIENT_H
|