diff --git a/src/Simplex/Chat/Library/Commands.hs b/src/Simplex/Chat/Library/Commands.hs index 0681cd27b9..99f753de61 100644 --- a/src/Simplex/Chat/Library/Commands.hs +++ b/src/Simplex/Chat/Library/Commands.hs @@ -5969,10 +5969,7 @@ liftWallet = either throwWalletError pure accountKey :: WalletSeed -> AccountIndex -> CM AccountKey accountKey seed n = liftWallet $ seedMaster (wsEntropy seed) >>= (`deriveAccountKey` n) --- | Walk the seed's accounts until 'scanGapLimit' in a row are untouched, --- asking each account on a relay the scan has not used yet: one relay seeing --- every address would learn they are one wallet. The counter lands past the --- last account in use, so the next name takes a free one. +-- | Walk the accounts until 'scanGapLimit' in a row are untouched, each on a relay the scan has not used, so no relay sees the whole wallet. scanAccounts :: NetworkRequestMode -> User -> WalletSeed -> CM ([AccountIndex], AccountIndex) scanAccounts nm user seed = go 0 [] [] 0 where diff --git a/src/Simplex/Chat/Wallet.hs b/src/Simplex/Chat/Wallet.hs index 2324b2070d..a39dc43a42 100644 --- a/src/Simplex/Chat/Wallet.hs +++ b/src/Simplex/Chat/Wallet.hs @@ -58,8 +58,7 @@ data WalletError | WEDerivation {derivationError :: String} -- BIP-32 or BIP-39 said no deriving (Eq, Show) --- | BIP-44's gap limit: a scan of a recovered seed stops after this many --- accounts in a row that nothing on chain has used. +-- | BIP-44's gap limit: a scan stops after this many accounts in a row that nothing on chain has used. scanGapLimit :: Int scanGapLimit = 20 diff --git a/tests/NameResolver.hs b/tests/NameResolver.hs index 5f61524684..bc4ac382a6 100644 --- a/tests/NameResolver.hs +++ b/tests/NameResolver.hs @@ -62,7 +62,7 @@ registerName reg SimplexNameInfo {nameDomain = SimplexDomain {nameTLD, domain}} atomically $ modifyTVar' reg $ M.insert (decodeLatin1 $ strEncode (labelHash domain) <> strEncode nameTLD) r -- | Register a name an address owns, for a wallet scan to find. -ownedName :: NameRegistry -> Text -> Text -> IO () +ownedName :: TVar (Map Text NameRecord) -> Text -> Text -> IO () ownedName reg name owner = atomically $ modifyTVar' reg $ M.insert name (emptyRecord name) {nrOwner = owner} contactNameRecord :: Text -> Text -> NameRecord