Author

Topic: bitcointools load wallet, print type+key+value in python (Read 1183 times)

legendary
Activity: 1232
Merit: 1076
legendary
Activity: 1232
Merit: 1076
legendary
Activity: 1232
Merit: 1076
I just get jibberish.

Code:
from bitcointools import util, wallet
from bitcointools.BCDataStream import BCDataStream
from bsddb import db as bdb
db_env = util.create_env()
db = wallet.open_wallet(db_env)
kds = BCDataStream()
vds = BCDataStream()
for key, val in db.items():
    kds.clear()
    kds.write(key)
    vds.clear()
    vds.write(val)
    type = kds.read_string()
    print type
Jump to: