// WalletStore store wallet using leveldb
type WalletStore struct {
- DB dbm.DB
+ DB dbm.DB
+ batch dbm.Batch
}
// NewWalletStore create new WalletStore struct
}
}
+func (store *WalletStore) initBatch() {
+ if store.batch == nil {
+ store.batch = store.DB.NewBatch()
+ }
+}
+
+func (store *WalletStore) commitBatch() {
+ if store.batch != nil {
+ store.batch.Write()
+ }
+}
+
// ContractKey account control promgram store prefix
func ContractKey(hash common.Hash) []byte {
return append([]byte(contractPrefix), hash[:]...)