// Manager stores accounts and their associated control programs.
type Manager struct {
- store AccountStorer
+ store AccountStore
chain *protocol.Chain
utxoKeeper *utxoKeeper
}
// NewManager creates a new account manager
-func NewManager(store AccountStorer, chain *protocol.Chain) *Manager {
+func NewManager(store AccountStore, chain *protocol.Chain) *Manager {
return &Manager{
store: store,
chain: chain,
"github.com/vapor/protocol/bc"
)
-// AccountStorer interface contains account storage functions.
-type AccountStorer interface {
+// AccountStore interface contains account storage functions.
+type AccountStore interface {
InitBatch() error
CommitBatch() error
DeleteAccount(*Account) error
// `sync/atomic` expects the first word in an allocated struct to be 64-bit
// aligned on both ARM and x86-32. See https://goo.gl/zW7dgq for more details.
nextIndex uint64
- store AccountStorer
+ store AccountStore
mtx sync.RWMutex
currentHeight func() uint64
reservations map[uint64]*reservation
}
-func newUtxoKeeper(f func() uint64, store AccountStorer) *utxoKeeper {
+func newUtxoKeeper(f func() uint64, store AccountStore) *utxoKeeper {
uk := &utxoKeeper{
store: store,
currentHeight: f,
"github.com/vapor/protocol/bc"
)
-// AccountStore satisfies AccountStorer interface.
+// AccountStore satisfies AccountStore interface.
type AccountStore struct {
accountDB dbm.DB
batch dbm.Batch