Skip to content

Commit 7ad720d

Browse files
author
dllud
committed
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.
1 parent 529047f commit 7ad720d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

contrib/bitrpc/bitrpc.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@
2222
print access.backupwallet(path)
2323
except:
2424
print "\n---An error occurred---\n"
25+
26+
elif cmd == "encryptwallet":
27+
try:
28+
pwd = getpass.getpass(prompt="Enter passphrase: ")
29+
pwd2 = getpass.getpass(prompt="Repeat passphrase: ")
30+
if pwd == pwd2:
31+
access.encryptwallet(pwd)
32+
print "\n---Wallet encrypted. Server stopping, restart to run with encrypted wallet---\n"
33+
else:
34+
print "\n---Passphrases do not match---\n"
35+
except:
36+
print "\n---An error occurred---\n"
2537

2638
elif cmd == "getaccount":
2739
try:

0 commit comments

Comments
 (0)