1
0

simple_config: implement complex default values

Besides a literal value, the default can now also be a callable,
which gets called with the config and evaluated as needed, lazily.

This potentially allows e.g. the default value of one configvar to
depend on the current value of another configvar.
This commit is contained in:
SomberNight
2023-09-07 15:30:46 +00:00
parent 201309a7f0
commit 6a2806c2c5
3 changed files with 46 additions and 18 deletions

View File

@@ -206,7 +206,7 @@ class SwapManager(Logger):
if swap.prepay_hash is not None:
self.prepayments[swap.prepay_hash] = bytes.fromhex(k)
# api url
self.api_url = wallet.config.get_swapserver_url()
self.api_url = wallet.config.SWAPSERVER_URL
# init default min & max
self.init_min_max_values()