Skip to content

Commit c61d596

Browse files
committed
fix
1 parent aae3f19 commit c61d596

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/rpc/methods/chain.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,14 @@ impl RpcMethod<1> for ForestChainExport {
338338

339339
tokio::select! {
340340
result = chain_export => {
341-
result.map(|_| ApiExportResult::Done)
341+
if let Some(checksum) = result? {
342+
let path = forest_car_sha256sum_path(&output_path);
343+
std::fs::write(path, format!("{} {}\n",
344+
checksum.encode_hex::<String>(),
345+
output_path.file_name().and_then(std::ffi::OsStr::to_str)
346+
.context("Failed to retrieve file name while saving checksum")?))?;
347+
}
348+
tmp_path.persist(&output_path)?;
342349
},
343350
_ = chain_export_guard.cancellation_token().cancelled() => {
344351
chain_export_guard.cancel_export();

0 commit comments

Comments
 (0)