aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/command_parser_executor.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-01-28 13:55:49 +0200
committerRiccardo Spagni <ric@spagni.net>2019-01-28 13:55:50 +0200
commit4a0e4c7d706f33fb72fe809434676b1de7b4b4f7 (patch)
tree36fdd03f84ae78dbd217b5bd255bd86e33db1bcc /src/daemon/command_parser_executor.cpp
parentMerge pull request #5008 (diff)
parentPruning (diff)
downloadmonero-4a0e4c7d706f33fb72fe809434676b1de7b4b4f7.tar.xz
Merge pull request #4843
b750fb27 Pruning (moneromooo-monero)
Diffstat (limited to '')
-rw-r--r--src/daemon/command_parser_executor.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp
index b5b747e97..37cb55ec8 100644
--- a/src/daemon/command_parser_executor.cpp
+++ b/src/daemon/command_parser_executor.cpp
@@ -717,4 +717,27 @@ bool t_command_parser_executor::version(const std::vector<std::string>& args)
return true;
}
+bool t_command_parser_executor::prune_blockchain(const std::vector<std::string>& args)
+{
+ if (args.size() > 1) return false;
+
+ if (args.empty() || args[0] != "confirm")
+ {
+ std::cout << "Warning: pruning from within monerod will not shrink the database file size." << std::endl;
+ std::cout << "Instead, parts of the file will be marked as free, so the file will not grow" << std::endl;
+ std::cout << "until that newly free space is used up. If you want a smaller file size now," << std::endl;
+ std::cout << "exit monerod and run monero-blockchain-prune (you will temporarily need more" << std::endl;
+ std::cout << "disk space for the database conversion though). If you are OK with the database" << std::endl;
+ std::cout << "file keeping the same size, re-run this command with the \"confirm\" parameter." << std::endl;
+ return true;
+ }
+
+ return m_executor.prune_blockchain();
+}
+
+bool t_command_parser_executor::check_blockchain_pruning(const std::vector<std::string>& args)
+{
+ return m_executor.check_blockchain_pruning();
+}
+
} // namespace daemonize