Skip to content
Bitcoin Roots

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. The two line-number columns refer to before and after.

src/rpc/blockchain.h CHANGED
@@ -5,6 +5,13 @@
5
5
  #ifndef BITCOIN_RPC_BLOCKCHAIN_H
6
6
  #define BITCOIN_RPC_BLOCKCHAIN_H
7
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>
8
15
  #include <consensus/amount.h>
9
16
  #include <core_io.h>
10
17
  #include <streams.h>
@@ -28,6 +35,19 @@ class BlockManager;
28
35
  struct NodeContext;
29
36
  } // namespace node
30
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
+
31
51
  static constexpr int NUM_GETBLOCKSTATS_PERCENTILES = 5;
32
52
 
33
53
  /**
@@ -62,4 +82,10 @@ UniValue CreateUTXOSnapshot(
62
82
  std::optional<int> GetPruneHeight(const node::BlockManager& blockman, const CChain& chain) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
63
83
  void CheckBlockDataAvailability(node::BlockManager& blockman, const CBlockIndex& blockindex, bool check_for_undo) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
64
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
+
65
91
  #endif // BITCOIN_RPC_BLOCKCHAIN_H