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 1010#include < logging.h> // For BCLog::CategoryMask
1111#include < net.h> // For NodeId
1212#include < net_types.h> // For banmap_t
13+ #include < node/utxo_snapshot.h> // For SnapshotMetadata
1314#include < netaddress.h> // For Network
1415#include < netbase.h> // For ConnectionDirection
1516#include < support/allocators/secure.h> // For SecureString
@@ -205,6 +206,9 @@ class Node
205206 // ! List rpc commands.
206207 virtual std::vector<std::string> listRpcCommands () = 0;
207208
209+ // ! Load and activate a snapshot file
210+ virtual bool loadSnapshot (AutoFile& coins_file, const node::SnapshotMetadata& metadata, bool in_memory) = 0;
211+
208212 // ! Set RPC timer interface if unset.
209213 virtual void rpcSetTimerInterfaceIfUnset (RPCTimerInterface* iface) = 0;
210214
Original file line number Diff line number Diff line change @@ -355,6 +355,11 @@ class NodeImpl : public Node
355355 return ::tableRPC.execute (req);
356356 }
357357 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+ }
358363 void rpcSetTimerInterfaceIfUnset (RPCTimerInterface* iface) override { RPCSetTimerInterfaceIfUnset (iface); }
359364 void rpcUnsetTimerInterface (RPCTimerInterface* iface) override { RPCUnsetTimerInterface (iface); }
360365 std::optional<Coin> getUnspentOutput (const COutPoint& output) override
You can’t perform that action at this time.
0 commit comments