From fa7314ea906700aa54378cc4a09bf0e456be3fd3 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 29 Jul 2021 22:47:33 +0300 Subject: [PATCH] dao: drop dropNEP17Cache from Cached It's not used now. --- pkg/core/dao/cacheddao.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkg/core/dao/cacheddao.go b/pkg/core/dao/cacheddao.go index 342b9d17b..f147deb85 100644 --- a/pkg/core/dao/cacheddao.go +++ b/pkg/core/dao/cacheddao.go @@ -15,15 +15,13 @@ type Cached struct { DAO balances map[util.Uint160]*state.NEP17TransferInfo transfers map[util.Uint160]map[uint32]*state.NEP17TransferLog - - dropNEP17Cache bool } // NewCached returns new Cached wrapping around given backing store. func NewCached(d DAO) *Cached { balances := make(map[util.Uint160]*state.NEP17TransferInfo) transfers := make(map[util.Uint160]map[uint32]*state.NEP17TransferLog) - return &Cached{d.GetWrapped(), balances, transfers, false} + return &Cached{d.GetWrapped(), balances, transfers} } // GetNEP17TransferInfo retrieves NEP17TransferInfo for the acc. @@ -87,9 +85,6 @@ func (cd *Cached) Persist() (int, error) { // usage scenario it should be good enough if cd doesn't modify object // caches (accounts/transfer data) in any way. if ok { - if cd.dropNEP17Cache { - lowerCache.balances = make(map[util.Uint160]*state.NEP17TransferInfo) - } var simpleCache *Simple for simpleCache == nil { simpleCache, ok = lowerCache.DAO.(*Simple) @@ -127,6 +122,5 @@ func (cd *Cached) GetWrapped() DAO { return &Cached{cd.DAO.GetWrapped(), cd.balances, cd.transfers, - false, } }