v31.1-roots.1 · Commit 6: [PATCH 06/17] feat(wallet): preserve Roots signing and spend controls on v31
src/rpc/blockchain.h
Before: src/rpc/blockchain.h · After: src/rpc/blockchain.h
File metadata
index efb06ac2d29b3e20552f6dd3c69675ca5e146972..3df6c96ecaa79e3515ac880fd3963836d83903b8 100644
Download original patch · Release notes
Diff rows 1–42 of 42. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/rpc/blockchain.h
CHANGED
|
@@ -5,6 +5,13 @@
|
|
| 5 |
#ifndef BITCOIN_RPC_BLOCKCHAIN_H
|
| 6 |
#define BITCOIN_RPC_BLOCKCHAIN_H
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
#include <consensus/amount.h>
|
| 9 |
#include <core_io.h>
|
| 10 |
#include <streams.h>
|
|
@@ -28,6 +35,19 @@ class BlockManager;
|
|
| 28 |
struct NodeContext;
|
| 29 |
} // namespace node
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
static constexpr int NUM_GETBLOCKSTATS_PERCENTILES = 5;
|
| 32 |
|
| 33 |
/**
|
|
@@ -62,4 +82,10 @@ UniValue CreateUTXOSnapshot(
|
|
| 62 |
std::optional<int> GetPruneHeight(const node::BlockManager& blockman, const CChain& chain) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
| 63 |
void CheckBlockDataAvailability(node::BlockManager& blockman, const CBlockIndex& blockindex, bool check_for_undo) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
#endif // BITCOIN_RPC_BLOCKCHAIN_H
|
|
|
|
| 5 |
#ifndef BITCOIN_RPC_BLOCKCHAIN_H
|
| 6 |
#define BITCOIN_RPC_BLOCKCHAIN_H
|
| 7 |
|
| 8 |
+
#include <set>
|
| 9 |
+
#include <map>
|
| 10 |
+
#include <functional>
|
| 11 |
+
#include <atomic>
|
| 12 |
+
#include <script/script.h>
|
| 13 |
+
#include <interfaces/chain.h>
|
| 14 |
+
#include <coins.h>
|
| 15 |
#include <consensus/amount.h>
|
| 16 |
#include <core_io.h>
|
| 17 |
#include <streams.h>
|
|
|
|
| 35 |
struct NodeContext;
|
| 36 |
} // namespace node
|
| 37 |
|
| 38 |
+
namespace rpc::scan {
|
| 39 |
+
extern std::atomic<int> g_progress;
|
| 40 |
+
extern std::atomic<bool> g_in_progress;
|
| 41 |
+
extern std::atomic<bool> g_should_abort;
|
| 42 |
+
class Reserver {
|
| 43 |
+
bool m_reserved{false};
|
| 44 |
+
public:
|
| 45 |
+
bool reserve();
|
| 46 |
+
~Reserver();
|
| 47 |
+
};
|
| 48 |
+
bool CheckInterruption(int64_t count, const std::function<void()>& interruption);
|
| 49 |
+
} // namespace rpc::scan
|
| 50 |
+
|
| 51 |
static constexpr int NUM_GETBLOCKSTATS_PERCENTILES = 5;
|
| 52 |
|
| 53 |
/**
|
|
|
|
| 82 |
std::optional<int> GetPruneHeight(const node::BlockManager& blockman, const CChain& chain) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
| 83 |
void CheckBlockDataAvailability(node::BlockManager& blockman, const CBlockIndex& blockindex, bool check_for_undo) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
| 84 |
|
| 85 |
+
//! Scan the current UTXO set while sharing scantxoutset's reservation and RPC
|
| 86 |
+
//! interruption behavior. The returned coins are a snapshot and must be
|
| 87 |
+
//! revalidated by the caller before broadcast.
|
| 88 |
+
interfaces::ScanResult ScanUTXOSet(node::NodeContext& node, const std::set<CScript>& needles, std::map<COutPoint, Coin>& coins,
|
| 89 |
+
const std::function<bool()>& should_abort = {});
|
| 90 |
+
|
| 91 |
#endif // BITCOIN_RPC_BLOCKCHAIN_H
|