New debug command 'debug watch incoming'

This commit is contained in:
Kleissner
2021-07-29 04:14:49 +02:00
parent 837e4a6d29
commit d9573cdb15
5 changed files with 40 additions and 4 deletions

View File

@@ -92,7 +92,8 @@ func showHelp() {
"debug key create Create Public-Private Key pair\n" +
"debug key self List current Public-Private Key pair\n" +
"debug connect Attempts to connect to the target peer\n" +
"debug watch searches Watches all outgoing DHT searches\n" +
"debug watch searches Watch all outgoing DHT searches\n" +
"debug watch incoming Watch all incoming information requests\n" +
"hash Create blake3 hash of input\n" +
"warehouse get Get data from local warehouse by hash\n" +
"warehouse store Store data into local warehouse\n" +
@@ -349,6 +350,14 @@ func userCommands() {
enableMonitorAll = number == 1
}
case "debug watch incoming":
fmt.Printf("Enable (1) or disable (0) watching of all incoming information requests? (current setting: %t)\n", enableWatchIncomingAll)
if number, valid := getUserOptionInt(reader); !valid || number < 0 || number > 1 {
fmt.Printf("Invalid option.\n")
} else {
enableWatchIncomingAll = number == 1
}
case "debug bucket refresh":
fmt.Printf("Disable (1) or enable (0) bucket refresh. This can be useful to disable bucket refresh when debugging outgoing DHT searches. (current setting: %t)\n", dht.DisableBucketRefresh)
if number, valid := getUserOptionInt(reader); !valid || number < 0 || number > 1 {