X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=wallet%2Fwallet.go;h=515316c23c6564a4a137ba4928c60dc947baea97;hb=a072d52d767a3eaa08f0409c75e0a9ca68a839ad;hp=92a24b96626ec3c44736ab67daab4209ede86170;hpb=1ec30c05550dfbd29a69dc212115304aa0e864fb;p=bytom%2Fvapor.git diff --git a/wallet/wallet.go b/wallet/wallet.go index 92a24b96..515316c2 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -9,7 +9,7 @@ import ( "github.com/vapor/account" "github.com/vapor/asset" "github.com/vapor/blockchain/pseudohsm" - dbm "github.com/vapor/database/leveldb" + "github.com/vapor/database/dbutils" "github.com/vapor/errors" "github.com/vapor/event" "github.com/vapor/protocol" @@ -42,7 +42,7 @@ type StatusInfo struct { //Wallet is related to storing account unspent outputs type Wallet struct { - DB dbm.DB + DB dbutils.DB rw sync.RWMutex status StatusInfo TxIndexFlag bool @@ -58,7 +58,7 @@ type Wallet struct { } //NewWallet return a new wallet instance -func NewWallet(walletDB dbm.DB, account *account.Manager, asset *asset.Registry, hsm *pseudohsm.HSM, chain *protocol.Chain, dispatcher *event.Dispatcher, txIndexFlag bool) (*Wallet, error) { +func NewWallet(walletDB dbutils.DB, account *account.Manager, asset *asset.Registry, hsm *pseudohsm.HSM, chain *protocol.Chain, dispatcher *event.Dispatcher, txIndexFlag bool) (*Wallet, error) { w := &Wallet{ DB: walletDB, AccountMgr: account, @@ -156,7 +156,7 @@ func (w *Wallet) loadWalletInfo() error { return w.AttachBlock(block) } -func (w *Wallet) commitWalletInfo(batch dbm.Batch) error { +func (w *Wallet) commitWalletInfo(batch dbutils.Batch) error { rawWallet, err := json.Marshal(w.status) if err != nil { log.WithFields(log.Fields{"module": logModule, "err": err}).Error("save wallet info")