mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
WIP
This commit is contained in:
@@ -275,7 +275,8 @@ func (s *StateDB) GetAccount(idx common.Idx) (*common.Account, error) {
|
||||
return GetAccountInTreeDB(s.db.DB(), idx)
|
||||
}
|
||||
|
||||
func accountsIter(db db.Storage, fn func(a *common.Account) (bool, error)) error {
|
||||
// AccountsIter iterates over all the accounts in db, calling fn for each one
|
||||
func AccountsIter(db db.Storage, fn func(a *common.Account) (bool, error)) error {
|
||||
idxDB := db.WithPrefix(PrefixKeyIdx)
|
||||
if err := idxDB.Iterate(func(k []byte, v []byte) (bool, error) {
|
||||
idx, err := common.IdxFromBytes(k)
|
||||
|
||||
Reference in New Issue
Block a user