From f846a16f07bb5cf3e8e4b51d30cc6d36772d2ea4 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 10 Jun 2025 14:45:25 +0000 Subject: [PATCH] plugins: psbt_nostr: add comment about testnet/mainnet separation --- electrum/plugins/psbt_nostr/psbt_nostr.py | 4 +++- electrum/wallet.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/electrum/plugins/psbt_nostr/psbt_nostr.py b/electrum/plugins/psbt_nostr/psbt_nostr.py index 2a4fa100d..e3d34208c 100644 --- a/electrum/plugins/psbt_nostr/psbt_nostr.py +++ b/electrum/plugins/psbt_nostr/psbt_nostr.py @@ -103,7 +103,9 @@ class CosignerWallet(Logger): self.cosigner_list = [] # type: List[Tuple[str, str]] self.nostr_pubkey = None - for key, keystore in wallet.keystores.items(): + for keystore in wallet.get_keystores(): + # note: there should be domain separation between testnet/mainnet. + # Currently there is, due to the xpub str encoding it in its header. xpub = keystore.get_master_public_key() # type: str privkey = sha256('nostr_psbt:' + xpub) pubkey = ecc.ECPrivkey(privkey).get_public_key_bytes()[1:] diff --git a/electrum/wallet.py b/electrum/wallet.py index aa87cefbc..57dbe600a 100644 --- a/electrum/wallet.py +++ b/electrum/wallet.py @@ -4048,7 +4048,7 @@ class Multisig_Wallet(Deterministic_Wallet): return [k.derive_pubkey(c, i).hex() for k in self.get_keystores()] def load_keystore(self): - self.keystores = {} + self.keystores = {} # type: Dict[str, KeyStore] for i in range(self.n): name = 'x%d' % (i+1) self.keystores[name] = load_keystore(self.db, name)