diff --git a/README.md b/README.md index 56e9f16..502b9d6 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ cashu info Returns: ```bash -Version: 0.5.3 +Version: 0.5.4 Debug: False Cashu dir: /home/user/.cashu Wallet: wallet diff --git a/cashu/core/settings.py b/cashu/core/settings.py index d2c8a97..2519278 100644 --- a/cashu/core/settings.py +++ b/cashu/core/settings.py @@ -53,4 +53,4 @@ LNBITS_ENDPOINT = env.str("LNBITS_ENDPOINT", default=None) LNBITS_KEY = env.str("LNBITS_KEY", default=None) MAX_ORDER = 64 -VERSION = "0.5.3" +VERSION = "0.5.4" diff --git a/cashu/mint/ledger.py b/cashu/mint/ledger.py index 3d41a7c..8f328ce 100644 --- a/cashu/mint/ledger.py +++ b/cashu/mint/ledger.py @@ -51,7 +51,7 @@ class Ledger: proofs_used = await self.crud.get_proofs_used(db=self.db) self.proofs_used = set(proofs_used) - async def load_keyset(self, derivation_path): + async def load_keyset(self, derivation_path, autosave=True): """Load current keyset keyset or generate new one.""" keyset = MintKeyset( seed=self.master_key, derivation_path=derivation_path, version=VERSION @@ -61,7 +61,7 @@ class Ledger: tmp_keyset_local: List[MintKeyset] = await self.crud.get_keyset( id=keyset.id, db=self.db ) - if not len(tmp_keyset_local): + if not len(tmp_keyset_local) and autosave: logger.debug(f"Storing keyset {keyset.id}.") await self.crud.store_keyset(keyset=keyset, db=self.db) @@ -69,7 +69,7 @@ class Ledger: self.keysets.keysets[keyset.id] = keyset return keyset - async def init_keysets(self): + async def init_keysets(self, autosave=True): """Loads all keysets from db.""" # load all past keysets from db tmp_keysets: List[MintKeyset] = await self.crud.get_keyset(db=self.db) @@ -80,7 +80,7 @@ class Ledger: logger.debug(f"Generating keys for keyset {v.id}") v.generate_keys(self.master_key) # load the current keyset - self.keyset = await self.load_keyset(self.derivation_path) + self.keyset = await self.load_keyset(self.derivation_path, autosave) async def _generate_promises( self, B_s: List[BlindedMessage], keyset: MintKeyset = None diff --git a/pyproject.toml b/pyproject.toml index 899d68c..ed30d3b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cashu" -version = "0.5.3" +version = "0.5.4" description = "Ecash wallet and mint." authors = ["calle "] license = "MIT" diff --git a/setup.py b/setup.py index f3a67b7..26e95c6 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ entry_points = {"console_scripts": ["cashu = cashu.wallet.cli:cli"]} setuptools.setup( name="cashu", - version="0.5.3", + version="0.5.4", description="Ecash wallet and mint with Bitcoin Lightning support", long_description=long_description, long_description_content_type="text/markdown",