Skip to content

Commit

Permalink
Update definitions in State
Browse files Browse the repository at this point in the history
  • Loading branch information
itamarcps committed Feb 8, 2024
1 parent 88d8579 commit b02a7d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ uint64_t State::getNativeNonce(const Address& addr) const {
return it->second.nonce;
}

const std::unordered_map<Address, Account, SafeHash>& State::getAccounts() const {
std::unordered_map<Address, Account, SafeHash> State::getAccounts() const {
std::shared_lock lock(this->stateMutex_);
return this->accounts_;
}

const std::unordered_map<Hash, TxBlock, SafeHash>& State::getMempool() const {
std::unordered_map<Hash, TxBlock, SafeHash> State::getMempool() const {
std::shared_lock lock(this->stateMutex_);
return this->mempool_;
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ class State {
uint64_t getNativeNonce(const Address& addr) const;

/// Getter for `accounts`. Returns a copy.
const std::unordered_map<Address, Account, SafeHash> getAccounts() const;
std::unordered_map<Address, Account, SafeHash> getAccounts() const;

/// Getter for `mempool`. Returns a copy.
const std::unordered_map<Hash, TxBlock, SafeHash> getMempool() const;
std::unordered_map<Hash, TxBlock, SafeHash> getMempool() const;

/// Get the mempool's current size.
inline size_t getMempoolSize() const {
Expand Down

0 comments on commit b02a7d7

Please sign in to comment.