@@ -5655,7 +5655,7 @@ util::Result<void> ChainstateManager::ActivateSnapshot(
5655
5655
int base_blockheight = metadata.m_base_blockheight ;
5656
5656
5657
5657
if (this ->SnapshotBlockhash ()) {
5658
- return util::Error{_ (" Can't activate a snapshot-based chainstate more than once" )};
5658
+ return util::Error{Untranslated (" Can't activate a snapshot-based chainstate more than once" )};
5659
5659
}
5660
5660
5661
5661
{
@@ -5664,26 +5664,26 @@ util::Result<void> ChainstateManager::ActivateSnapshot(
5664
5664
if (!GetParams ().AssumeutxoForBlockhash (base_blockhash).has_value ()) {
5665
5665
auto available_heights = GetParams ().GetAvailableSnapshotHeights ();
5666
5666
std::string heights_formatted = util::Join (available_heights, " , " , [&](const auto & i) { return util::ToString (i); });
5667
- return util::Error{strprintf (_ (" assumeutxo block hash in snapshot metadata not recognized (hash: %s, height: %s). The following snapshot heights are available: %s. " ),
5667
+ return util::Error{strprintf (Untranslated (" assumeutxo block hash in snapshot metadata not recognized (hash: %s, height: %s). The following snapshot heights are available: %s" ),
5668
5668
base_blockhash.ToString (),
5669
5669
base_blockheight,
5670
5670
heights_formatted)};
5671
5671
}
5672
5672
5673
5673
CBlockIndex* snapshot_start_block = m_blockman.LookupBlockIndex (base_blockhash);
5674
5674
if (!snapshot_start_block) {
5675
- return util::Error{strprintf (_ (" The base block header (%s) must appear in the headers chain. Make sure all headers are syncing, and call loadtxoutset again. " ),
5675
+ return util::Error{strprintf (Untranslated (" The base block header (%s) must appear in the headers chain. Make sure all headers are syncing, and call loadtxoutset again" ),
5676
5676
base_blockhash.ToString ())};
5677
5677
}
5678
5678
5679
5679
bool start_block_invalid = snapshot_start_block->nStatus & BLOCK_FAILED_MASK;
5680
5680
if (start_block_invalid) {
5681
- return util::Error{strprintf (_ (" The base block header (%s) is part of an invalid chain. " ), base_blockhash.ToString ())};
5681
+ return util::Error{strprintf (Untranslated (" The base block header (%s) is part of an invalid chain" ), base_blockhash.ToString ())};
5682
5682
}
5683
5683
5684
5684
auto mempool{m_active_chainstate->GetMempool ()};
5685
5685
if (mempool && mempool->size () > 0 ) {
5686
- return util::Error{_ (" Can't activate a snapshot when mempool not empty. " )};
5686
+ return util::Error{Untranslated (" Can't activate a snapshot when mempool not empty" )};
5687
5687
}
5688
5688
}
5689
5689
@@ -5732,7 +5732,7 @@ util::Result<void> ChainstateManager::ActivateSnapshot(
5732
5732
static_cast <size_t >(current_coinstip_cache_size * SNAPSHOT_CACHE_PERC));
5733
5733
}
5734
5734
5735
- auto cleanup_bad_snapshot = [&](const char * reason) EXCLUSIVE_LOCKS_REQUIRED (::cs_main) {
5735
+ auto cleanup_bad_snapshot = [&](bilingual_str&& reason) EXCLUSIVE_LOCKS_REQUIRED (::cs_main) {
5736
5736
this ->MaybeRebalanceCaches ();
5737
5737
5738
5738
// PopulateAndValidateSnapshot can return (in error) before the leveldb datadir
@@ -5748,12 +5748,12 @@ util::Result<void> ChainstateManager::ActivateSnapshot(
5748
5748
" Manually remove it before restarting.\n " ), fs::PathToString (*snapshot_datadir)));
5749
5749
}
5750
5750
}
5751
- return util::Error{_ (reason)};
5751
+ return util::Error{std::move (reason)};
5752
5752
};
5753
5753
5754
5754
if (!this ->PopulateAndValidateSnapshot (*snapshot_chainstate, coins_file, metadata)) {
5755
5755
LOCK (::cs_main);
5756
- return cleanup_bad_snapshot (" population failed" );
5756
+ return cleanup_bad_snapshot (Untranslated ( " population failed" ) );
5757
5757
}
5758
5758
5759
5759
LOCK (::cs_main); // cs_main required for rest of snapshot activation.
@@ -5762,13 +5762,13 @@ util::Result<void> ChainstateManager::ActivateSnapshot(
5762
5762
// work chain than the active chainstate; a user could have loaded a snapshot
5763
5763
// very late in the IBD process, and we wouldn't want to load a useless chainstate.
5764
5764
if (!CBlockIndexWorkComparator ()(ActiveTip (), snapshot_chainstate->m_chain .Tip ())) {
5765
- return cleanup_bad_snapshot (" work does not exceed active chainstate" );
5765
+ return cleanup_bad_snapshot (Untranslated ( " work does not exceed active chainstate" ) );
5766
5766
}
5767
5767
// If not in-memory, persist the base blockhash for use during subsequent
5768
5768
// initialization.
5769
5769
if (!in_memory) {
5770
5770
if (!node::WriteSnapshotBaseBlockhash (*snapshot_chainstate)) {
5771
- return cleanup_bad_snapshot (" could not write base blockhash" );
5771
+ return cleanup_bad_snapshot (Untranslated ( " could not write base blockhash" ) );
5772
5772
}
5773
5773
}
5774
5774
0 commit comments