OSDN Git Service

remove SetStandardUTXO in walletstore
authorChengcheng Zhang <943420582@qq.com>
Tue, 2 Jul 2019 14:58:40 +0000 (22:58 +0800)
committerChengcheng Zhang <943420582@qq.com>
Tue, 2 Jul 2019 14:58:40 +0000 (22:58 +0800)
database/wallet_store.go
wallet/store.go

index 6614c4a..2f4a846 100644 (file)
@@ -477,20 +477,6 @@ func (store *WalletStore) SetRecoveryStatus(recoveryKey, rawStatus []byte) {
        }
 }
 
-// SetStandardUTXO set standard utxo
-func (store *WalletStore) SetStandardUTXO(outputID bc.Hash, utxo *acc.UTXO) error {
-       data, err := json.Marshal(utxo)
-       if err != nil {
-               return err
-       }
-       if store.batch == nil {
-               store.walletDB.Set(StandardUTXOKey(outputID), data)
-       } else {
-               store.batch.Set(StandardUTXOKey(outputID), data)
-       }
-       return nil
-}
-
 // SetTransaction set raw transaction by block height and tx position
 func (store *WalletStore) SetTransaction(height uint64, tx *query.AnnotatedTx) error {
        batch := store.walletDB.NewBatch()
index cd16923..e0f33d0 100644 (file)
@@ -14,7 +14,7 @@ type WalletStore interface {
        DeleteContractUTXO(bc.Hash)
        DeleteRecoveryStatus()
        DeleteStandardUTXO(bc.Hash) // delete it
-       DeleteTransactions(uint64)  
+       DeleteTransactions(uint64)
        DeleteUnconfirmedTransaction(string)
        DeleteWalletTransactions()
        DeleteWalletUTXOs()
@@ -33,7 +33,6 @@ type WalletStore interface {
        SetContractUTXO(bc.Hash, *acc.UTXO) error
        SetGlobalTransactionIndex(string, *bc.Hash, uint64)
        SetRecoveryStatus([]byte, []byte) // recoveryManager.state isn't exported outside
-       SetStandardUTXO(bc.Hash, *acc.UTXO) error // delete it
        SetTransaction(uint64, *query.AnnotatedTx) error
        SetUnconfirmedTransaction(string, *query.AnnotatedTx) error
        SetWalletInfo([]byte) // need move database.NewWalletStore in wallet package