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)
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)))
}
}
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 {