Skip to content
Bitcoin Roots

v29.4-roots.4 · Commit 23: [PATCH 23/37] feat(wallet): add transient private-key sweep RPC

src/rpc/blockchain.h

Before: src/rpc/blockchain.h · After: src/rpc/blockchain.h

File metadata
index 954ede6519b4c7f7f85ba4d3462538581431dedb..7bb178a247694325ca712f7c217dbc0c77638667 100644

Download original patch · Release notes

Diff rows 1–50 of 50. 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
@@ -7,14 +7,22 @@
7
 
8
  #include <consensus/amount.h>
9
  #include <core_io.h>
 
10
  #include <streams.h>
11
  #include <sync.h>
12
  #include <util/fs.h>
13
  #include <validation.h>
14
 
 
 
 
15
  #include <any>
 
 
16
  #include <stdint.h>
17
  #include <vector>
 
 
18
 
19
  class CBlock;
20
  class CBlockIndex;
@@ -25,6 +33,19 @@ class BlockManager;
25
  struct NodeContext;
26
  } // namespace node
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  static constexpr int NUM_GETBLOCKSTATS_PERCENTILES = 5;
29
 
30
  /**
@@ -59,4 +80,9 @@ UniValue CreateUTXOSnapshot(
59
  std::optional<int> GetPruneHeight(const node::BlockManager& blockman, const CChain& chain) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
60
  void CheckBlockDataAvailability(node::BlockManager& blockman, const CBlockIndex& blockindex, bool check_for_undo) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
61
 
 
 
 
 
 
62
  #endif // BITCOIN_RPC_BLOCKCHAIN_H
 
7
 
8
  #include <consensus/amount.h>
9
  #include <core_io.h>
10
+ #include <interfaces/chain.h>
11
  #include <streams.h>
12
  #include <sync.h>
13
  #include <util/fs.h>
14
  #include <validation.h>
15
 
16
+ #include <coins.h>
17
+ #include <script/script.h>
18
+
19
  #include <any>
20
+ #include <atomic>
21
+ #include <functional>
22
  #include <stdint.h>
23
  #include <vector>
24
+ #include <map>
25
+ #include <set>
26
 
27
  class CBlock;
28
  class CBlockIndex;
 
33
  struct NodeContext;
34
  } // namespace node
35
 
36
+ namespace rpc::scan {
37
+ extern std::atomic<int> g_progress;
38
+ extern std::atomic<bool> g_in_progress;
39
+ extern std::atomic<bool> g_should_abort;
40
+ class Reserver {
41
+ bool m_reserved{false};
42
+ public:
43
+ bool reserve();
44
+ ~Reserver();
45
+ };
46
+ bool CheckInterruption(int64_t count, const std::function<void()>& interruption);
47
+ } // namespace rpc::scan
48
+
49
  static constexpr int NUM_GETBLOCKSTATS_PERCENTILES = 5;
50
 
51
  /**
 
80
  std::optional<int> GetPruneHeight(const node::BlockManager& blockman, const CChain& chain) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
81
  void CheckBlockDataAvailability(node::BlockManager& blockman, const CBlockIndex& blockindex, bool check_for_undo) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
82
 
83
+ //! Scan the current UTXO set while sharing scantxoutset's reservation and RPC
84
+ //! interruption behavior. The returned coins are a snapshot and must be
85
+ //! revalidated by the caller before broadcast.
86
+ interfaces::ScanResult ScanUTXOSet(node::NodeContext& node, const std::set<CScript>& needles, std::map<COutPoint, Coin>& coins);
87
+
88
  #endif // BITCOIN_RPC_BLOCKCHAIN_H