OSDN Git Service

rename GetAccountUtxos
authorChengcheng Zhang <943420582@qq.com>
Sat, 22 Jun 2019 06:15:36 +0000 (14:15 +0800)
committerChengcheng Zhang <943420582@qq.com>
Sat, 22 Jun 2019 06:15:36 +0000 (14:15 +0800)
wallet/store.go
wallet/utxo.go

index ecab401..17f6759 100644 (file)
@@ -39,7 +39,7 @@ type Store interface {
        SetWalletInfo([]byte)
        DeleteWalletTransactions()
        DeleteWalletUTXOs()
-       GetAccountUtxos(key string) []*account.UTXO
+       GetAccountUTXOs(key string) []*account.UTXO
        SetRecoveryStatus([]byte, []byte)
        DeleteRecoveryStatus([]byte)
        GetRecoveryStatus([]byte) []byte
@@ -264,8 +264,8 @@ func (store *LevelDBStore) DeleteWalletUTXOs() {
        storeBatch.Write()
 }
 
-// GetAccountUtxos get all account unspent outputs
-func (store *LevelDBStore) GetAccountUtxos(key string) []*account.UTXO {
+// GetAccountUTXOs get all account unspent outputs
+func (store *LevelDBStore) GetAccountUTXOs(key string) []*account.UTXO {
        accountUtxos := []*account.UTXO{}
        accountUtxoIter := store.DB.IteratorPrefix([]byte(key))
        defer accountUtxoIter.Release()
@@ -273,7 +273,7 @@ func (store *LevelDBStore) GetAccountUtxos(key string) []*account.UTXO {
        for accountUtxoIter.Next() {
                accountUtxo := &account.UTXO{}
                if err := json.Unmarshal(accountUtxoIter.Value(), accountUtxo); err != nil {
-                       log.WithFields(log.Fields{"module": logModule, "err": err}).Warn("GetAccountUtxos fail on unmarshal utxo")
+                       log.WithFields(log.Fields{"module": logModule, "err": err}).Warn("GetAccountUTXOs fail on unmarshal utxo")
                        continue
                }
                accountUtxos = append(accountUtxos, accountUtxo)
index 9ea6a47..c10963e 100644 (file)
@@ -26,7 +26,7 @@ func (w *Wallet) GetAccountUtxos(accountID string, id string, unconfirmed, isSma
                accountUtxos = w.AccountMgr.ListUnconfirmedUtxo(accountID, isSmartContract)
        }
 
-       confirmedUtxos := w.store.GetAccountUtxos(prefix + id)
+       confirmedUtxos := w.store.GetAccountUTXOs(prefix + id)
        accountUtxos = append(accountUtxos, confirmedUtxos...)
        newAccountUtxos := []*account.UTXO{}
        for _, accountUtxo := range accountUtxos {