File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 10
10
#include < logging.h> // For BCLog::CategoryMask
11
11
#include < net.h> // For NodeId
12
12
#include < net_types.h> // For banmap_t
13
+ #include < node/utxo_snapshot.h> // For SnapshotMetadata
13
14
#include < netaddress.h> // For Network
14
15
#include < netbase.h> // For ConnectionDirection
15
16
#include < support/allocators/secure.h> // For SecureString
@@ -205,6 +206,9 @@ class Node
205
206
// ! List rpc commands.
206
207
virtual std::vector<std::string> listRpcCommands () = 0;
207
208
209
+ // ! Load and activate a snapshot file
210
+ virtual bool loadSnapshot (AutoFile& coins_file, const node::SnapshotMetadata& metadata, bool in_memory) = 0;
211
+
208
212
// ! Set RPC timer interface if unset.
209
213
virtual void rpcSetTimerInterfaceIfUnset (RPCTimerInterface* iface) = 0;
210
214
Original file line number Diff line number Diff line change @@ -355,6 +355,11 @@ class NodeImpl : public Node
355
355
return ::tableRPC.execute (req);
356
356
}
357
357
std::vector<std::string> listRpcCommands () override { return ::tableRPC.listCommands (); }
358
+ bool loadSnapshot (AutoFile& coins_file, const SnapshotMetadata& metadata, bool in_memory) override
359
+ {
360
+ auto activation_result{chainman ().ActivateSnapshot (coins_file, metadata, in_memory)};
361
+ return activation_result.has_value ();
362
+ }
358
363
void rpcSetTimerInterfaceIfUnset (RPCTimerInterface* iface) override { RPCSetTimerInterfaceIfUnset (iface); }
359
364
void rpcUnsetTimerInterface (RPCTimerInterface* iface) override { RPCUnsetTimerInterface (iface); }
360
365
std::optional<Coin> getUnspentOutput (const COutPoint& output) override
You can’t perform that action at this time.
0 commit comments