8 return bytes.encode('hex_codec')
11 t = bytes.encode('hex_codec')
14 return t[0:4]+"..."+t[-4:]
16 def determine_db_dir():
20 if platform.system() == "Darwin":
21 return os.path.expanduser("~/Library/Application Support/Bitcoin/")
22 elif platform.system() == "Windows":
23 return os.path.join(os.environ['APPDATA'], "Bitcoin")
24 return os.path.expanduser("~/.bitcoin")
26 def create_env(db_dir=None):
28 db_dir = determine_db_dir()
30 r = db_env.open(db_dir,
31 (DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|
32 DB_INIT_TXN|DB_THREAD|DB_RECOVER))