@@ -2571,7 +2571,7 @@ static RPCHelpMan dumptxoutset()
2571
2571
{
2572
2572
return RPCHelpMan{
2573
2573
" dumptxoutset" ,
2574
- " Write the serialized UTXO set to disk ." ,
2574
+ " Write the serialized UTXO set to a file ." ,
2575
2575
{
2576
2576
{" path" , RPCArg::Type::STR, RPCArg::Optional::NO, " Path to the output file. If relative, will be prefixed by datadir." },
2577
2577
},
@@ -2699,7 +2699,7 @@ static RPCHelpMan loadtxoutset()
2699
2699
{
2700
2700
return RPCHelpMan{
2701
2701
" loadtxoutset" ,
2702
- " Load the serialized UTXO set from disk .\n "
2702
+ " Load the serialized UTXO set from a file .\n "
2703
2703
" Once this snapshot is loaded, its contents will be "
2704
2704
" deserialized into a second chainstate data structure, which is then used to sync to "
2705
2705
" the network's tip. "
@@ -2753,34 +2753,14 @@ static RPCHelpMan loadtxoutset()
2753
2753
throw JSONRPCError (RPC_INTERNAL_ERROR, strprintf (" Unable to load UTXO snapshot, "
2754
2754
" assumeutxo block hash in snapshot metadata not recognized (%s)" , base_blockhash.ToString ()));
2755
2755
}
2756
- int max_secs_to_wait_for_headers = 60 * 10 ;
2757
- CBlockIndex* snapshot_start_block = nullptr ;
2758
-
2759
- LogPrintf (" [snapshot] waiting to see blockheader %s in headers chain before snapshot activation\n " ,
2760
- base_blockhash.ToString ());
2761
-
2762
- while (max_secs_to_wait_for_headers > 0 ) {
2763
- snapshot_start_block = WITH_LOCK (::cs_main,
2756
+ CBlockIndex* snapshot_start_block = WITH_LOCK (::cs_main,
2764
2757
return chainman.m_blockman .LookupBlockIndex (base_blockhash));
2765
- max_secs_to_wait_for_headers -= 1 ;
2766
-
2767
- if (!IsRPCRunning ()) {
2768
- throw JSONRPCError (RPC_CLIENT_NOT_CONNECTED, " Shutting down" );
2769
- }
2770
-
2771
- if (!snapshot_start_block) {
2772
- std::this_thread::sleep_for (std::chrono::seconds (1 ));
2773
- } else {
2774
- break ;
2775
- }
2776
- }
2777
2758
2778
2759
if (!snapshot_start_block) {
2779
- LogPrintf (" [snapshot] timed out waiting for snapshot start blockheader %s\n " ,
2780
- base_blockhash.ToString ());
2781
2760
throw JSONRPCError (
2782
2761
RPC_INTERNAL_ERROR,
2783
- " Timed out waiting for base block header to appear in headers chain" );
2762
+ strprintf (" The base block header (%s) must appear in the headers chain. Make sure all headers are syncing, and call this RPC again." ,
2763
+ base_blockhash.ToString ()));
2784
2764
}
2785
2765
if (!chainman.ActivateSnapshot (afile, metadata, false )) {
2786
2766
throw JSONRPCError (RPC_INTERNAL_ERROR, " Unable to load UTXO snapshot " + fs::PathToString (path));
0 commit comments