Skip to content

Commit

Permalink
#1702 change [] to at()
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev committed Nov 22, 2023
1 parent 1a67380 commit 7700738
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libethereum/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ void Client::initHistoricGroupIndex() {

void Client::updateHistoricGroupIndex() {
uint64_t blockTimestamp = blockInfo( hashFromNumber( number() ) ).timestamp();
uint64_t currentFinishTs = chainParams().sChain.nodeGroups[historicGroupIndex].finishTs;
uint64_t currentFinishTs = chainParams().sChain.nodeGroups.at( historicGroupIndex ).finishTs;
if ( blockTimestamp >= currentFinishTs )
++historicGroupIndex;
if ( historicGroupIndex >= chainParams().sChain.nodeGroups.size() ) {
Expand Down
11 changes: 7 additions & 4 deletions libethereum/Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,22 +297,25 @@ class Client : public ClientBase, protected Worker {
}

std::array< std::string, 4 > getIMABLSPublicKey() const {
return chainParams().sChain.nodeGroups[historicGroupIndex].blsPublicKey;
return chainParams().sChain.nodeGroups.at( historicGroupIndex ).blsPublicKey;
}

// get node id for historic node in chain
std::string getHistoricNodeId( unsigned _id ) const {
return chainParams().sChain.nodeGroups[historicGroupIndex].nodes[_id].id.str();
return chainParams().sChain.nodeGroups.at( historicGroupIndex ).nodes[_id].id.str();
}

// get schain index for historic node in chain
std::string getHistoricNodeIndex( unsigned _idx ) const {
return chainParams().sChain.nodeGroups[historicGroupIndex].nodes[_idx].schainIndex.str();
return chainParams()
.sChain.nodeGroups.at( historicGroupIndex )
.nodes[_idx]
.schainIndex.str();
}

// get node owner for historic node in chain
std::string getHistoricNodePublicKey( unsigned _idx ) const {
return chainParams().sChain.nodeGroups[historicGroupIndex].nodes[_idx].publicKey;
return chainParams().sChain.nodeGroups.at( historicGroupIndex ).nodes[_idx].publicKey;
}

void doStateDbCompaction() const { m_state.getOriginalDb()->doCompaction(); }
Expand Down

0 comments on commit 7700738

Please sign in to comment.