1
0

move point of sale mode into plugins

This commit is contained in:
thomasv
2013-03-03 13:50:08 +01:00
parent f1c638c509
commit cd9f366735
4 changed files with 347 additions and 245 deletions

View File

@@ -91,7 +91,6 @@ class Wallet:
self.imported_keys = config.get('imported_keys',{})
self.history = config.get('addr_history',{}) # address -> list(txid, height)
self.tx_height = config.get('tx_height',{})
self.requested_amounts = config.get('requested_amounts',{})
self.accounts = config.get('accounts', {}) # this should not include public keys
self.sequences = {}
@@ -146,6 +145,10 @@ class Wallet:
if callback in h: h.remove(callback)
self.plugin_hooks[name] = h
def run_hook(self, name, args):
for cb in self.plugin_hooks.get(name,[]):
apply(cb, args)
def init_plugins(self, plugins):
self.plugins = plugins
for p in plugins:
@@ -1039,7 +1042,6 @@ class Wallet:
'gap_limit': self.gap_limit,
'transactions': tx,
'tx_height': self.tx_height,
'requested_amounts': self.requested_amounts,
}
for k, v in s.items():
self.config.set_key(k,v)