def get_wallet_or_create(mpk): if mpk in wallets.keys(): return wallets[mpk] if os.path.exists("wallets/"+mpk): w = Wallet() w.set_path("wallets/"+mpk) w.read() return w w = Wallet() w.master_public_key = mpk.decode('hex') w.set_path("wallets/"+mpk) w.create_new_address(False) w.save() return w
def get_wallet_or_create(mpk): if mpk in wallets.keys(): return wallets[mpk] if os.path.exists("wallets/" + mpk): w = Wallet() w.set_path("wallets/" + mpk) w.read() return w w = Wallet() w.master_public_key = mpk.decode('hex') w.set_path("wallets/" + mpk) w.create_new_address(False) w.save() return w
- private keys are not needed in order to generate new addresses. A neutralized wallet can be used (seed removed) - no gap limit: use 'getnum' to know how many addresses have been created. todo: - return the max gap - add expiration date """ host = 'localhost' port = 8444 wallet_path = 'wallet_path' username = '******' password = '******' wallet = Wallet() master_public_key_hex = "112cee2e893f9e2531b15f013b05a921b917933a310191122470661995e9083ad873e574929a982e142fb3c3c1c3c38a98894802feef7b1c177cc3970cbf708b" # wallet.master_public_key = master_public_key_hex.decode("hex") stopping = False wallets = {} from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCRequestHandler import SimpleXMLRPCServer class authHandler(SimpleJSONRPCRequestHandler): def parse_request(self): if SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.parse_request(self): if self.authenticate(self.headers): return True else:
- generates new addresses on request - private keys are not needed in order to generate new addresses. A neutralized wallet can be used (seed removed) - no gap limit: use 'getnum' to know how many addresses have been created. todo: - return the max gap - add expiration date """ host = 'localhost' port = 8444 wallet_path = 'wallet_path' username = '******' password = '******' wallet = Wallet() master_public_key_hex = "112cee2e893f9e2531b15f013b05a921b917933a310191122470661995e9083ad873e574929a982e142fb3c3c1c3c38a98894802feef7b1c177cc3970cbf708b" # wallet.master_public_key = master_public_key_hex.decode("hex") stopping = False wallets = {} from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCRequestHandler import SimpleXMLRPCServer class authHandler(SimpleJSONRPCRequestHandler): def parse_request(self): if SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.parse_request(self): if self.authenticate(self.headers): return True