[#4200] Enable prevention of tx detection on unrevealed mnemonic/address (#4444)

This commit is contained in:
Roman Volosovskyi 2024-01-16 15:17:02 +01:00 committed by GitHub
parent a5acffc001
commit 9aef13f83e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 6 deletions

View File

@ -1 +1 @@
0.172.3
0.172.4

View File

@ -1352,7 +1352,7 @@ func (b *GethStatusBackend) generateOrImportAccount(mnemonic string, customizati
if mnemonic == "" {
settings.Mnemonic = &info.Mnemonic
settings.OmitTransfersHistoryScan = true
//settings.MnemonicWasNotShown = true
settings.MnemonicWasNotShown = true
}
nodeConfig, err := defaultNodeConfig(settings.InstallationID, request)

View File

@ -1148,6 +1148,13 @@ func (m *Messenger) RequestToJoinCommunity(request *requests.RequestToJoinCommun
return nil, err
}
for _, account := range requestToJoin.RevealedAccounts {
err := m.settings.AddressWasShown(types.HexToAddress(account.Address))
if err != nil {
return nil, err
}
}
return response, nil
}

View File

@ -97,7 +97,7 @@ func (c *findNewBlocksCommand) findAndSaveEthBlocks(parent context.Context, from
}
for _, account := range c.accounts {
if mnemonicCheckEnabled && mnemonicWasNotShown {
if mnemonicWasNotShown {
acc, err := c.accountsDB.GetAccountByAddress(nodetypes.Address(account))
if err != nil {
c.error = err
@ -423,8 +423,6 @@ func (c *findBlocksCommand) checkERC20Tail(parent context.Context, account commo
return foundHeaders, nil
}
var mnemonicCheckEnabled = false
func (c *findBlocksCommand) Run(parent context.Context) (err error) {
log.Debug("start findBlocksCommand", "accounts", c.accounts, "chain", c.chainClient.NetworkID(), "noLimit", c.noLimit, "from", c.fromBlockNumber, "to", c.toBlockNumber)
@ -435,7 +433,7 @@ func (c *findBlocksCommand) Run(parent context.Context) (err error) {
return err
}
if mnemonicCheckEnabled && mnemonicWasNotShown {
if mnemonicWasNotShown {
account, err := c.accountsDB.GetAccountByAddress(nodetypes.BytesToAddress(account.Bytes()))
if err != nil {
c.error = err