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