mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-24 03:54:21 +01:00
force sorted dictionary for keyset calculation
This commit is contained in:
@@ -38,7 +38,9 @@ def derive_pubkeys(keys: Dict[int, PrivateKey]):
|
||||
|
||||
def derive_keyset_id(keys: Dict[int, PublicKey]):
|
||||
"""Deterministic derivation keyset_id from set of public keys."""
|
||||
pubkeys_concat = "".join([p.serialize().hex() for _, p in keys.items()])
|
||||
# sort public keys by amount
|
||||
sorted_keys = dict(sorted(keys.items()))
|
||||
pubkeys_concat = "".join([p.serialize().hex() for _, p in sorted_keys.items()])
|
||||
return base64.b64encode(
|
||||
hashlib.sha256((pubkeys_concat).encode("utf-8")).digest()
|
||||
).decode()[:12]
|
||||
|
||||
@@ -8,7 +8,6 @@ from loguru import logger
|
||||
from cashu.core.migrations import migrate_databases
|
||||
from cashu.core.settings import CASHU_DIR, LIGHTNING
|
||||
|
||||
# from cashu.lightning import WALLET
|
||||
from cashu.mint import migrations
|
||||
|
||||
from cashu.mint.ledger import Ledger
|
||||
|
||||
Reference in New Issue
Block a user