OSDN Git Service
(root)
/
bytom
/
vapor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
283b16c
)
update listutxos
author
Chengcheng Zhang
<943420582@qq.com>
Sat, 29 Jun 2019 05:42:07 +0000
(13:42 +0800)
committer
Chengcheng Zhang
<943420582@qq.com>
Sat, 29 Jun 2019 05:42:07 +0000
(13:42 +0800)
account/accounts.go
patch
|
blob
|
history
account/image.go
patch
|
blob
|
history
account/store.go
patch
|
blob
|
history
account/utxo_keeper.go
patch
|
blob
|
history
database/account_store.go
patch
|
blob
|
history
database/wallet_store.go
patch
|
blob
|
history
test/mock/UTXO.go
patch
|
blob
|
history
wallet/store.go
patch
|
blob
|
history
wallet/utxo.go
patch
|
blob
|
history
diff --git
a/account/accounts.go
b/account/accounts.go
index
f134d36
..
4dcd4b2
100644
(file)
--- a/
account/accounts.go
+++ b/
account/accounts.go
@@
-417,7
+417,7
@@
func (m *Manager) GetCoinbaseCtrlProgram() (*CtrlProgram, error) {
}
account := new(Account)
}
account := new(Account)
- accounts, err := m.store.
Ge
tAccounts("")
+ accounts, err := m.store.
Lis
tAccounts("")
if err != nil {
return nil, err
}
if err != nil {
return nil, err
}
@@
-484,12
+484,12
@@
func (m *Manager) IsLocalControlProgram(prog []byte) bool {
// ListAccounts will return the accounts in the db
func (m *Manager) ListAccounts(id string) ([]*Account, error) {
// ListAccounts will return the accounts in the db
func (m *Manager) ListAccounts(id string) ([]*Account, error) {
- return m.store.
Ge
tAccounts(id)
+ return m.store.
Lis
tAccounts(id)
}
// ListControlProgram return all the local control program
func (m *Manager) ListControlProgram() ([]*CtrlProgram, error) {
}
// ListControlProgram return all the local control program
func (m *Manager) ListControlProgram() ([]*CtrlProgram, error) {
- return m.store.
Ge
tControlPrograms()
+ return m.store.
Lis
tControlPrograms()
}
func (m *Manager) ListUnconfirmedUtxo(accountID string, isSmartContract bool) []*UTXO {
}
func (m *Manager) ListUnconfirmedUtxo(accountID string, isSmartContract bool) []*UTXO {
diff --git
a/account/image.go
b/account/image.go
index
62ce449
..
6ad7657
100644
(file)
--- a/
account/image.go
+++ b/
account/image.go
@@
-25,7
+25,7
@@
func (m *Manager) Backup() (*Image, error) {
Slice: []*ImageSlice{},
}
Slice: []*ImageSlice{},
}
- accounts, err := m.store.
Ge
tAccounts("")
+ accounts, err := m.store.
Lis
tAccounts("")
if err != nil {
return nil, err
}
if err != nil {
return nil, err
}
diff --git
a/account/store.go
b/account/store.go
index
820f75a
..
7007284
100644
(file)
--- a/
account/store.go
+++ b/
account/store.go
@@
-29,12
+29,12
@@
type AccountStorer interface {
SetMiningAddress(*CtrlProgram) error
GetBip44ContractIndex(string, bool) uint64
GetControlProgram(common.Hash) (*CtrlProgram, error)
SetMiningAddress(*CtrlProgram) error
GetBip44ContractIndex(string, bool) uint64
GetControlProgram(common.Hash) (*CtrlProgram, error)
-
Ge
tAccounts(string) ([]*Account, error)
-
Ge
tControlPrograms() ([]*CtrlProgram, error)
+
Lis
tAccounts(string) ([]*Account, error)
+
Lis
tControlPrograms() ([]*CtrlProgram, error)
SetControlProgram(common.Hash, *CtrlProgram) error
SetContractIndex(string, uint64)
SetBip44ContractIndex(string, bool, uint64)
SetControlProgram(common.Hash, *CtrlProgram) error
SetContractIndex(string, uint64)
SetBip44ContractIndex(string, bool, uint64)
-
Ge
tUTXOs() []*UTXO
+
Lis
tUTXOs() []*UTXO
GetUTXO(bc.Hash) (*UTXO, error)
SetStandardUTXO(bc.Hash, *UTXO) error
}
GetUTXO(bc.Hash) (*UTXO, error)
SetStandardUTXO(bc.Hash, *UTXO) error
}
diff --git
a/account/utxo_keeper.go
b/account/utxo_keeper.go
index
57d5d68
..
db2abf1
100644
(file)
--- a/
account/utxo_keeper.go
+++ b/
account/utxo_keeper.go
@@
-219,7
+219,7
@@
func (uk *utxoKeeper) findUtxos(accountID string, assetID *bc.AssetID, useUnconf
}
}
}
}
- UTXOs := uk.store.
Ge
tUTXOs()
+ UTXOs := uk.store.
Lis
tUTXOs()
for _, UTXO := range UTXOs {
appendUtxo(UTXO)
}
for _, UTXO := range UTXOs {
appendUtxo(UTXO)
}
diff --git
a/database/account_store.go
b/database/account_store.go
index
f1f8bf0
..
8074fb5
100644
(file)
--- a/
database/account_store.go
+++ b/
database/account_store.go
@@
-275,8
+275,8
@@
func (store *AccountStore) GetControlProgram(hash common.Hash) (*acc.CtrlProgram
return cp, nil
}
return cp, nil
}
-//
Ge
tAccounts get all accounts which name prfix is id.
-func (store *AccountStore)
Ge
tAccounts(id string) ([]*acc.Account, error) {
+//
Lis
tAccounts get all accounts which name prfix is id.
+func (store *AccountStore)
Lis
tAccounts(id string) ([]*acc.Account, error) {
accounts := []*acc.Account{}
accountIter := store.accountDB.IteratorPrefix(AccountIDKey(strings.TrimSpace(id)))
defer accountIter.Release()
accounts := []*acc.Account{}
accountIter := store.accountDB.IteratorPrefix(AccountIDKey(strings.TrimSpace(id)))
defer accountIter.Release()
@@
-291,8
+291,8
@@
func (store *AccountStore) GetAccounts(id string) ([]*acc.Account, error) {
return accounts, nil
}
return accounts, nil
}
-//
Ge
tControlPrograms get all local control programs
-func (store *AccountStore)
Ge
tControlPrograms() ([]*acc.CtrlProgram, error) {
+//
Lis
tControlPrograms get all local control programs
+func (store *AccountStore)
Lis
tControlPrograms() ([]*acc.CtrlProgram, error) {
cps := []*acc.CtrlProgram{}
cpIter := store.accountDB.IteratorPrefix([]byte(ContractPrefix))
defer cpIter.Release()
cps := []*acc.CtrlProgram{}
cpIter := store.accountDB.IteratorPrefix([]byte(ContractPrefix))
defer cpIter.Release()
@@
-339,8
+339,8
@@
func (store *AccountStore) SetBip44ContractIndex(accountID string, change bool,
}
}
}
}
-//
Ge
tUTXOs get utxos by accountID
-func (store *AccountStore)
Ge
tUTXOs() []*acc.UTXO {
+//
Lis
tUTXOs get utxos by accountID
+func (store *AccountStore)
Lis
tUTXOs() []*acc.UTXO {
utxoIter := store.accountDB.IteratorPrefix([]byte(UTXOPrefix))
defer utxoIter.Release()
utxoIter := store.accountDB.IteratorPrefix([]byte(UTXOPrefix))
defer utxoIter.Release()
diff --git
a/database/wallet_store.go
b/database/wallet_store.go
index
4b6ac0c
..
9add00b
100644
(file)
--- a/
database/wallet_store.go
+++ b/
database/wallet_store.go
@@
-505,8
+505,8
@@
func (store *WalletStore) DeleteWalletUTXOs() {
}
}
}
}
-//
Ge
tAccountUTXOs get all account unspent outputs
-func (store *WalletStore)
Ge
tAccountUTXOs(key string) ([]*acc.UTXO, error) {
+//
Lis
tAccountUTXOs get all account unspent outputs
+func (store *WalletStore)
Lis
tAccountUTXOs(key string) ([]*acc.UTXO, error) {
accountUtxoIter := store.walletDB.IteratorPrefix([]byte(key))
defer accountUtxoIter.Release()
accountUtxoIter := store.walletDB.IteratorPrefix([]byte(key))
defer accountUtxoIter.Release()
diff --git
a/test/mock/UTXO.go
b/test/mock/UTXO.go
index
b7e1e15
..
079c3d8
100644
(file)
--- a/
test/mock/UTXO.go
+++ b/
test/mock/UTXO.go
@@
-165,7
+165,7
@@
func (uk *UTXOKeeper) FindUtxos(accountID string, assetID *bc.AssetID, useUnconf
}
}
}
}
- UTXOs := uk.Store.
Ge
tUTXOs()
+ UTXOs := uk.Store.
Lis
tUTXOs()
for _, UTXO := range UTXOs {
appendUtxo(UTXO)
}
for _, UTXO := range UTXOs {
appendUtxo(UTXO)
}
diff --git
a/wallet/store.go
b/wallet/store.go
index
3d7cce3
..
88ea808
100644
(file)
--- a/
wallet/store.go
+++ b/
wallet/store.go
@@
-35,7
+35,7
@@
type WalletStorer interface {
SetWalletInfo([]byte) // need move database.NewWalletStore in wallet package
DeleteWalletTransactions()
DeleteWalletUTXOs()
SetWalletInfo([]byte) // need move database.NewWalletStore in wallet package
DeleteWalletTransactions()
DeleteWalletUTXOs()
-
Ge
tAccountUTXOs(string) ([]*acc.UTXO, error)
+
Lis
tAccountUTXOs(string) ([]*acc.UTXO, error)
SetRecoveryStatus([]byte, []byte) // recoveryManager.state isn't exported outside
DeleteRecoveryStatus()
GetRecoveryStatus([]byte) []byte // recoveryManager.state isn't exported outside
SetRecoveryStatus([]byte, []byte) // recoveryManager.state isn't exported outside
DeleteRecoveryStatus()
GetRecoveryStatus([]byte) []byte // recoveryManager.state isn't exported outside
diff --git
a/wallet/utxo.go
b/wallet/utxo.go
index
6ad0380
..
4c4e654
100644
(file)
--- a/
wallet/utxo.go
+++ b/
wallet/utxo.go
@@
-24,7
+24,7
@@
func (w *Wallet) GetAccountUtxos(accountID string, id string, unconfirmed, isSma
accountUtxos = w.AccountMgr.ListUnconfirmedUtxo(accountID, isSmartContract)
}
accountUtxos = w.AccountMgr.ListUnconfirmedUtxo(accountID, isSmartContract)
}
- confirmedUTXOs, err := w.store.
Ge
tAccountUTXOs(string(prefix) + id)
+ confirmedUTXOs, err := w.store.
Lis
tAccountUTXOs(string(prefix) + id)
if err != nil {
log.WithFields(log.Fields{"module": logModule, "err": err}).Error("GetAccountUtxos fail.")
}
if err != nil {
log.WithFields(log.Fields{"module": logModule, "err": err}).Error("GetAccountUtxos fail.")
}