mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-23 00:02:28 +00:00
shrink diff
This commit is contained in:
1 parent
610610a73c
commit
3225b86829
3 files changed
+3
-7
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user