@@ -82,7 +82,7 @@ UniValue WriteUTXOSnapshot(
82
82
CCoinsViewCursor* pcursor,
83
83
CCoinsStats* maybe_stats,
84
84
const CBlockIndex* tip,
85
- AutoFile& afile,
85
+ AutoFile&& afile,
86
86
const fs::path& path,
87
87
const fs::path& temppath,
88
88
const std::function<void ()>& interruption_point = {});
@@ -3114,7 +3114,14 @@ static RPCHelpMan dumptxoutset()
3114
3114
}
3115
3115
}
3116
3116
3117
- UniValue result = WriteUTXOSnapshot (*chainstate, cursor.get (), &stats, tip, afile, path, temppath, node.rpc_interruption_point );
3117
+ UniValue result = WriteUTXOSnapshot (*chainstate,
3118
+ cursor.get (),
3119
+ &stats,
3120
+ tip,
3121
+ std::move (afile),
3122
+ path,
3123
+ temppath,
3124
+ node.rpc_interruption_point );
3118
3125
fs::rename (temppath, path);
3119
3126
3120
3127
result.pushKV (" path" , path.utf8string ());
@@ -3166,7 +3173,7 @@ UniValue WriteUTXOSnapshot(
3166
3173
CCoinsViewCursor* pcursor,
3167
3174
CCoinsStats* maybe_stats,
3168
3175
const CBlockIndex* tip,
3169
- AutoFile& afile,
3176
+ AutoFile&& afile,
3170
3177
const fs::path& path,
3171
3178
const fs::path& temppath,
3172
3179
const std::function<void ()>& interruption_point)
@@ -3240,12 +3247,19 @@ UniValue WriteUTXOSnapshot(
3240
3247
UniValue CreateUTXOSnapshot (
3241
3248
node::NodeContext& node,
3242
3249
Chainstate& chainstate,
3243
- AutoFile& afile,
3250
+ AutoFile&& afile,
3244
3251
const fs::path& path,
3245
3252
const fs::path& tmppath)
3246
3253
{
3247
3254
auto [cursor, stats, tip]{WITH_LOCK (::cs_main, return PrepareUTXOSnapshot (chainstate, node.rpc_interruption_point ))};
3248
- return WriteUTXOSnapshot (chainstate, cursor.get (), &stats, tip, afile, path, tmppath, node.rpc_interruption_point );
3255
+ return WriteUTXOSnapshot (chainstate,
3256
+ cursor.get (),
3257
+ &stats,
3258
+ tip,
3259
+ std::move (afile),
3260
+ path,
3261
+ tmppath,
3262
+ node.rpc_interruption_point );
3249
3263
}
3250
3264
3251
3265
static RPCHelpMan loadtxoutset ()
0 commit comments