}
}
-// 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()
DeleteContractUTXO(bc.Hash)
DeleteRecoveryStatus()
DeleteStandardUTXO(bc.Hash) // delete it
- DeleteTransactions(uint64)
+ DeleteTransactions(uint64)
DeleteUnconfirmedTransaction(string)
DeleteWalletTransactions()
DeleteWalletUTXOs()
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