aboutsummaryrefslogtreecommitdiff
path: root/contrib/bitrpc
diff options
context:
space:
mode:
authordllud <david.ludovino@gmail.com>2014-06-17 04:22:47 +0100
committerdllud <david.ludovino@gmail.com>2014-06-17 04:22:47 +0100
commit7ad720d89020837ba1831055d8ee4eb955075f89 (patch)
tree6ea32725cff16ef2f83018b174d81aafab0fff7f /contrib/bitrpc
parent529047fcd18acd1b64dc95d6eb69edeaad75d405 (diff)
Added encryptwallet call to bitrpc.py
This was the only call requiring password input which was still missing. Much useful to avoid leaving a plain text passphrase in the shell log.
Diffstat (limited to 'contrib/bitrpc')
-rw-r--r--contrib/bitrpc/bitrpc.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/bitrpc/bitrpc.py b/contrib/bitrpc/bitrpc.py
index a84d7e34dd..02577b1b6a 100644
--- a/contrib/bitrpc/bitrpc.py
+++ b/contrib/bitrpc/bitrpc.py
@@ -22,6 +22,18 @@ if cmd == "backupwallet":
print access.backupwallet(path)
except:
print "\n---An error occurred---\n"
+
+elif cmd == "encryptwallet":
+ try:
+ pwd = getpass.getpass(prompt="Enter passphrase: ")
+ pwd2 = getpass.getpass(prompt="Repeat passphrase: ")
+ if pwd == pwd2:
+ access.encryptwallet(pwd)
+ print "\n---Wallet encrypted. Server stopping, restart to run with encrypted wallet---\n"
+ else:
+ print "\n---Passphrases do not match---\n"
+ except:
+ print "\n---An error occurred---\n"
elif cmd == "getaccount":
try: