Changed bitrpc.py's raw_input to getpass for passwords to conceal characters during command line input. Getpass is in Python stdlib so no additional dependencies required.
This commit is contained in:
parent
85bba09bfd
commit
0f63504463
1 changed files with 4 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
from jsonrpc import ServiceProxy
|
from jsonrpc import ServiceProxy
|
||||||
import sys
|
import sys
|
||||||
import string
|
import string
|
||||||
|
import getpass
|
||||||
|
|
||||||
# ===== BEGIN USER SETTINGS =====
|
# ===== BEGIN USER SETTINGS =====
|
||||||
# if you do not set these you will be prompted for a password for every command
|
# if you do not set these you will be prompted for a password for every command
|
||||||
|
@ -302,7 +303,7 @@ elif cmd == "validateaddress":
|
||||||
|
|
||||||
elif cmd == "walletpassphrase":
|
elif cmd == "walletpassphrase":
|
||||||
try:
|
try:
|
||||||
pwd = raw_input("Enter wallet passphrase: ")
|
pwd = getpass.getpass(prompt="Enter wallet passphrase: ")
|
||||||
access.walletpassphrase(pwd, 60)
|
access.walletpassphrase(pwd, 60)
|
||||||
print "\n---Wallet unlocked---\n"
|
print "\n---Wallet unlocked---\n"
|
||||||
except:
|
except:
|
||||||
|
@ -310,8 +311,8 @@ elif cmd == "walletpassphrase":
|
||||||
|
|
||||||
elif cmd == "walletpassphrasechange":
|
elif cmd == "walletpassphrasechange":
|
||||||
try:
|
try:
|
||||||
pwd = raw_input("Enter old wallet passphrase: ")
|
pwd = getpass.getpass(prompt="Enter old wallet passphrase: ")
|
||||||
pwd2 = raw_input("Enter new wallet passphrase: ")
|
pwd2 = getpass.getpass(prompt="Enter new wallet passphrase: ")
|
||||||
access.walletpassphrasechange(pwd, pwd2)
|
access.walletpassphrasechange(pwd, pwd2)
|
||||||
print
|
print
|
||||||
print "\n---Passphrase changed---\n"
|
print "\n---Passphrase changed---\n"
|
||||||
|
|
Loading…
Add table
Reference in a new issue