Checks if wallet.dat and config.ini is in folder
Checks if wallet.dat and config.ini is in same folder as the script. Small update to the bat file that tries 3 ways of running the script.
This commit is contained in:
parent
9e94022af5
commit
2376dc784b
|
@ -1,10 +1,14 @@
|
|||
@echo off
|
||||
python walletaid.py
|
||||
walletaid.py
|
||||
IF ERRORLEVEL 1 (
|
||||
CLS
|
||||
python walletaid.py
|
||||
)
|
||||
IF ERRORLEVEL 1 (
|
||||
CLS
|
||||
"C:\python27\python.exe" walletaid.py
|
||||
)
|
||||
if ERRORLEVEL 1 (
|
||||
IF ERRORLEVEL 1 (
|
||||
CLS
|
||||
ECHO Check Python install
|
||||
)
|
||||
|
|
15
walletaid.py
15
walletaid.py
|
@ -7,10 +7,19 @@ is borrowed from pywallet.
|
|||
|
||||
import hashlib
|
||||
import binascii
|
||||
from os import path
|
||||
from ConfigParser import SafeConfigParser
|
||||
|
||||
#Opens config.ini and gets settings
|
||||
#Opens config.ini and gets settings, checks if wallet.dat is in folder
|
||||
config = SafeConfigParser()
|
||||
|
||||
if not path.exists("config.ini"):
|
||||
print "The config.ini file was not found"
|
||||
exit(0)
|
||||
if not path.exists("wallet.dat"):
|
||||
print "The wallet.dat file is not in folder or has different name"
|
||||
exit(0)
|
||||
|
||||
config.read("config.ini")
|
||||
pubprefix = config.get("settings", "pubkeyprefix")
|
||||
privprefix = config.get("settings", "privkeyprefix")
|
||||
|
@ -115,10 +124,6 @@ def hashtowif(b):
|
|||
def address(c):
|
||||
pubkey = str(g * c)
|
||||
pubkey = ("0" * (64 - pubkey.index(" "))) + pubkey
|
||||
#if pubkey[63] == " ":
|
||||
# pubkey = "0" + pubkey
|
||||
#if pubkey[62] == " ":
|
||||
# pubkey = "00" + pubkey
|
||||
if compressed:
|
||||
if int(pubkey[-1], base=16) % 2 == 0:
|
||||
pref = "02"
|
||||
|
|
Loading…
Reference in New Issue