forked from bitcoinafterlife/bal-electrum-plugin
fix tx_fees wallet and other bug fixes to be compatible with electrum 0.6.2-master(0.6.3)
This commit is contained in:
27
bal.py
27
bal.py
@@ -7,11 +7,16 @@ from electrum import json_db
|
||||
from electrum.transaction import tx_from_any
|
||||
|
||||
import os
|
||||
json_db.register_dict('heirs', tuple, None)
|
||||
json_db.register_dict('will', lambda x: get_will(x), None)
|
||||
json_db.register_dict('will_settings', lambda x:x, None)
|
||||
def get_will_settings(x):
|
||||
print(x)
|
||||
|
||||
json_db.register_dict('heirs', tuple, None)
|
||||
json_db.register_dict('will', dict,None)
|
||||
json_db.register_dict('will_settings', lambda x:x,None)
|
||||
#{'rubiconda': ['bcrt1qgv0wu4v6kjzef5mnxfh2m9z6y7mez0ja0tt8mu', '45%', '1y'], 'veronica': ['bcrt1q6vxuvwrt8x5c9u9u29y5uq7frscr0vgc2dy60j', '15%', '1y']}
|
||||
from electrum.logging import get_logger
|
||||
def get_will_settings(x):
|
||||
print(x)
|
||||
|
||||
def get_will(x):
|
||||
try:
|
||||
@@ -22,6 +27,7 @@ def get_will(x):
|
||||
|
||||
class BalConfig():
|
||||
def __init__(self, config, name, default):
|
||||
print("init bal_config")
|
||||
self.config = config
|
||||
self.name = name
|
||||
self.default = default
|
||||
@@ -53,6 +59,7 @@ class BalPlugin(BasePlugin):
|
||||
SIZE = (159, 97)
|
||||
|
||||
def __init__(self, parent, config, name):
|
||||
print("init bal_plugin")
|
||||
self.logger = get_logger(__name__)
|
||||
BasePlugin.__init__(self, parent, config, name)
|
||||
self.base_dir = os.path.join(config.electrum_path(), 'bal')
|
||||
@@ -102,7 +109,7 @@ class BalPlugin(BasePlugin):
|
||||
}
|
||||
})
|
||||
self.WILL_SETTINGS = BalConfig(config, "bal_will_settings", {
|
||||
'tx_fees':100,
|
||||
'baltx_fees':100,
|
||||
'threshold':'180d',
|
||||
'locktime':'1y',
|
||||
})
|
||||
@@ -124,11 +131,19 @@ class BalPlugin(BasePlugin):
|
||||
self.HIDE_REPLACED.set(self._hide_replaced)
|
||||
|
||||
def validate_will_settings(self,will_settings):
|
||||
if int(will_settings.get('tx_fees',1))<1:
|
||||
will_settings['tx_fees']=1
|
||||
print(type(will_settings))
|
||||
print(will_settings.get('baltx_fees',1),1)
|
||||
if int(will_settings.get('baltx_fees',1))<1:
|
||||
will_settings['baltx_fees']=1
|
||||
if not will_settings.get('threshold'):
|
||||
will_settings['threshold']='180d'
|
||||
if not will_settings.get('locktime')=='':
|
||||
will_settings['locktime']='1y'
|
||||
return will_settings
|
||||
|
||||
def default_will_settings(self):
|
||||
return {
|
||||
'baltx_fees':100,
|
||||
'threshold':'180d',
|
||||
'locktime':'1y'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user