OSDN Git Service

remove DeleteBip44ContractIndex DeleteContractIndex DeleteControlProgram
authorChengcheng Zhang <943420582@qq.com>
Mon, 1 Jul 2019 02:33:22 +0000 (10:33 +0800)
committerChengcheng Zhang <943420582@qq.com>
Mon, 1 Jul 2019 02:33:22 +0000 (10:33 +0800)
account/store.go
database/account_store.go

index 0e4f471..93e7bec 100644 (file)
@@ -10,9 +10,6 @@ type AccountStorer interface {
        InitBatch() error
        CommitBatch() error
        DeleteAccount(*Account) error
-       DeleteBip44ContractIndex(string)
-       DeleteContractIndex(string)
-       DeleteControlProgram(bc.Hash)
        DeleteStandardUTXO(bc.Hash)
        GetAccountByAlias(string) (*Account, error)
        GetAccountByID(string) (*Account, error)
index e59d1ef..2f4aca7 100644 (file)
@@ -65,7 +65,6 @@ func (store *AccountStore) DeleteAccount(account *acc.Account) error {
        for _, cp := range cps {
                if cp.AccountID == account.ID {
                        sha3pool.Sum256(hash[:], cp.ControlProgram)
-                       // store.DeleteControlProgram(bc.NewHash(hash))
                        batch.Delete(ContractKey(bc.NewHash(hash)))
                }
        }
@@ -112,37 +111,6 @@ func (store *AccountStore) DeleteAccountUTXOs(accountID string) error {
        return nil
 }
 
-// DeleteBip44ContractIndex delete bip44 contract index by accountID
-func (store *AccountStore) DeleteBip44ContractIndex(accountID string) {
-       batch := store.accountDB.NewBatch()
-       if store.batch != nil {
-               batch = store.batch
-       }
-       batch.Delete(Bip44ContractIndexKey(accountID, false))
-       batch.Delete(Bip44ContractIndexKey(accountID, true))
-       if store.batch == nil {
-               batch.Write()
-       }
-}
-
-// DeleteContractIndex delete contract index by accountID
-func (store *AccountStore) DeleteContractIndex(accountID string) {
-       if store.batch == nil {
-               store.accountDB.Delete(contractIndexKey(accountID))
-       } else {
-               store.batch.Delete(contractIndexKey(accountID))
-       }
-}
-
-// DeleteControlProgram delete raw control program by hash
-func (store *AccountStore) DeleteControlProgram(hash bc.Hash) {
-       if store.batch == nil {
-               store.accountDB.Delete(ContractKey(hash))
-       } else {
-               store.batch.Delete(ContractKey(hash))
-       }
-}
-
 // DeleteStandardUTXO delete utxo by outpu id
 func (store *AccountStore) DeleteStandardUTXO(outputID bc.Hash) {
        if store.batch == nil {