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:
Dwerg 2018-02-21 15:39:57 +01:00 committed by GitHub
parent 9e94022af5
commit 2376dc784b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 8 deletions

View File

@ -1,11 +1,15 @@
@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
)
@pause
@pause

View File

@ -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"