diff --git a/services/wallet/transfer/commands_sequential.go b/services/wallet/transfer/commands_sequential.go index 8e296c73f..95d01b7ee 100644 --- a/services/wallet/transfer/commands_sequential.go +++ b/services/wallet/transfer/commands_sequential.go @@ -54,7 +54,25 @@ func (c *findNewBlocksCommand) Run(parent context.Context) (err error) { func (c *findNewBlocksCommand) findAndSaveEthBlocks(parent context.Context, fromNum, headNum *big.Int) { // Check ETH transfers for each account independently + mnemonicWasNotShown, err := c.accountsDB.GetMnemonicWasNotShown() + if err != nil { + c.error = err + return + } + for _, account := range c.accounts { + if mnemonicCheckEnabled && mnemonicWasNotShown { + acc, err := c.accountsDB.GetAccountByAddress(nodetypes.Address(account)) + if err != nil { + c.error = err + return + } + if acc.AddressWasNotShown { + log.Info("skip findNewBlocksCommand, mnemonic has not been shown and the address has not been shared yet", "address", account) + continue + } + } + log.Debug("start findNewBlocksCommand", "account", account, "chain", c.chainClient.NetworkID(), "noLimit", c.noLimit, "from", fromNum, "to", headNum) headers, startBlockNum, _ := c.findBlocksWithEthTransfers(parent, account, fromNum, headNum) diff --git a/services/wallet/transfer/commands_sequential_test.go b/services/wallet/transfer/commands_sequential_test.go index 7053c74f6..28fee6dcd 100644 --- a/services/wallet/transfer/commands_sequential_test.go +++ b/services/wallet/transfer/commands_sequential_test.go @@ -1076,7 +1076,7 @@ func TestFetchTransfersForLoadedBlocks(t *testing.T) { address := common.HexToAddress("0x1234") chainClient := newMockChainClient() tracker := transactions.NewPendingTxTracker(db, chainClient, nil, &event.Feed{}, transactions.PendingCheckInterval) - accDB, err := accounts.NewDB(wdb.client) + accDB, err := accounts.NewDB(appdb) require.NoError(t, err) cmd := &loadBlocksAndTransfersCommand{ @@ -1153,7 +1153,7 @@ func TestFetchNewBlocksCommand_findBlocksWithEthTransfers(t *testing.T) { blockChannel := make(chan []*DBHeader, 10) address := common.HexToAddress("0x1234") - accDB, err := accounts.NewDB(wdb.client) + accDB, err := accounts.NewDB(appdb) require.NoError(t, err) for idx, testCase := range getNewBlocksCases() { @@ -1229,7 +1229,7 @@ func TestFetchNewBlocksCommand(t *testing.T) { address1 := common.HexToAddress("0x1234") address2 := common.HexToAddress("0x5678") - accDB, err := accounts.NewDB(wdb.client) + accDB, err := accounts.NewDB(appdb) require.NoError(t, err) tc := &TestClient{