From 86b9ec97e1428c0c66f01eacfe7893a28dcb2231 Mon Sep 17 00:00:00 2001 From: levoncrypto Date: Fri, 25 Sep 2026 12:07:52 +0400 Subject: [PATCH 1/2] pick owner address distinct from payout and voting addresses --- lib/wallets/wallet/impl/firo_wallet.dart | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/wallets/wallet/impl/firo_wallet.dart b/lib/wallets/wallet/impl/firo_wallet.dart index 230ba6c65..a9b0f0b68 100644 --- a/lib/wallets/wallet/impl/firo_wallet.dart +++ b/lib/wallets/wallet/impl/firo_wallet.dart @@ -1020,20 +1020,22 @@ class FiroWallet extends Bip39HDWallet ); } + bool isUsableOwner(Address? address) => + address != null && + address.value != collateralAddress && + address.value != payoutAddress && + address.value != votingAddress; + Address? ownerAddress = await getCurrentReceivingAddress(); const maxOwnerAttempts = 32; - for ( - var i = 0; - i < maxOwnerAttempts && - (ownerAddress == null || ownerAddress.value == collateralAddress); - i++ - ) { + for (var i = 0; i < maxOwnerAttempts && !isUsableOwner(ownerAddress); i++) { await generateNewReceivingAddress(); ownerAddress = await getCurrentReceivingAddress(); } - if (ownerAddress == null || ownerAddress.value == collateralAddress) { + if (ownerAddress == null || !isUsableOwner(ownerAddress)) { throw Exception( - "Could not derive owner address distinct from collateral address.", + "Could not derive owner address distinct from collateral, payout " + "and voting addresses.", ); } From 19add823757f10041dfe103b3e6908a70092ca06 Mon Sep 17 00:00:00 2001 From: levoncrypto Date: Fri, 25 Sep 2026 12:18:47 +0400 Subject: [PATCH 2/2] allow owner address to equal voting address --- lib/wallets/wallet/impl/firo_wallet.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/wallets/wallet/impl/firo_wallet.dart b/lib/wallets/wallet/impl/firo_wallet.dart index a9b0f0b68..2ddbd50e8 100644 --- a/lib/wallets/wallet/impl/firo_wallet.dart +++ b/lib/wallets/wallet/impl/firo_wallet.dart @@ -1023,8 +1023,7 @@ class FiroWallet extends Bip39HDWallet bool isUsableOwner(Address? address) => address != null && address.value != collateralAddress && - address.value != payoutAddress && - address.value != votingAddress; + address.value != payoutAddress; Address? ownerAddress = await getCurrentReceivingAddress(); const maxOwnerAttempts = 32; @@ -1034,8 +1033,8 @@ class FiroWallet extends Bip39HDWallet } if (ownerAddress == null || !isUsableOwner(ownerAddress)) { throw Exception( - "Could not derive owner address distinct from collateral, payout " - "and voting addresses.", + "Could not derive owner address distinct from collateral and payout " + "addresses.", ); }