diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index ce03477fb21..e57e461b29a 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2698,7 +2698,7 @@ static RPCHelpMan dumptxoutset() "This call may take several minutes. Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)", { {"path", RPCArg::Type::STR, RPCArg::Optional::NO, "Path to the output file. If relative, will be prefixed by datadir."}, - {"type", RPCArg::Type::STR, RPCArg::Default(""), "The type of snapshot to create. Can be \"latest\" to create a snapshot of the current UTXO set or \"rollback\" to temporarily roll back the state of the node to a historical block before creating the snapshot of a historical UTXO set. This parameter can be omitted if a separate \"rollback\" named parameter is specified indicating the height or hash of a specific historical block. If \"rollback\" is specified and separate \"rollback\" named parameter is not specified, this will roll back to the latest valid snapshot block that currently be loaded with loadtxoutset."}, + {"type", RPCArg::Type::STR, RPCArg::Default(""), "The type of snapshot to create. Can be \"latest\" to create a snapshot of the current UTXO set or \"rollback\" to temporarily roll back the state of the node to a historical block before creating the snapshot of a historical UTXO set. This parameter can be omitted if a separate \"rollback\" named parameter is specified indicating the height or hash of a specific historical block. If \"rollback\" is specified and separate \"rollback\" named parameter is not specified, this will roll back to the latest valid snapshot block that can currently be loaded with loadtxoutset."}, {"options", RPCArg::Type::OBJ_NAMED_PARAMS, RPCArg::Optional::OMITTED, "", { {"rollback", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, @@ -2790,7 +2790,12 @@ static RPCHelpMan dumptxoutset() // this so we don't punish peers that send us that send us data that // seems wrong in this temporary state. For example a normal new block // would be classified as a block connecting an invalid block. - disable_network = std::make_unique(connman); + // Skip if the network is already disabled because this + // automatically re-enables the network activity at the end of the + // process which may not be what the user wants. + if (connman.GetNetworkActive()) { + disable_network = std::make_unique(connman); + } invalidate_index = WITH_LOCK(::cs_main, return node.chainman->ActiveChain().Next(target_index)); InvalidateBlock(*node.chainman, invalidate_index->GetBlockHash());