Skip to content

Commit

Permalink
Node: bugfix in older account matching
Browse files Browse the repository at this point in the history
  • Loading branch information
valdok committed Nov 24, 2023
1 parent 7dfd709 commit d111b37
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ struct Node::AccountRefreshCtx
AccountRefreshCtx(Node& n) :m_This(n) {}

Node& m_This;
std::map<Merkle::Hash, uint32_t> m_Map;
std::map<Merkle::Hash, size_t> m_Map;

BlobEncoder m_Coder;

Expand Down Expand Up @@ -1241,7 +1241,8 @@ void Node::RefreshAccounts()
if (sizeof(Merkle::Hash) == key.n)
{
// older-format account. Would be upgraded on 1st run
arc.m_Map[*reinterpret_cast<const Merkle::Hash*>(key.p)] = acc.m_iAccount;
const auto& hv = *reinterpret_cast<const Merkle::Hash*>(key.p);
arc.m_Map[hv] = accs.size() - 1;
}
else
{
Expand Down

0 comments on commit d111b37

Please sign in to comment.