Skip to content

Redundant database read in addressmanager #1540

@JoeGruffins

Description

@JoeGruffins

This issue is an attempt to solve this TODO:

// TODO: Instead of opening a second read transaction after making a change, and
// then fetching the account properties with a new read tx, this can be made
// more performant by simply returning the new account properties during the
// change.

I think this TODO is talking about the AccountProperties method when the account is not imported, one read is done to check if the account is invalid and in the accountInfo map, and another is done to get the last used address index. To make it only read once loadAccountInfo needs to store or return the index data.

However, the TODO also makes a reference to "making a change" which makes me think I don't understand the problem correctly. Are changes being made somewhere else in the code, then this is being called when those changes could return the AccountProperties?

After understanding the problem I would like to work on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions