Rename some Account variables.

This commit is contained in:
Josh Rickmar 2013-11-21 11:23:50 -05:00
parent 649112b764
commit 57802d8daf
2 changed files with 16 additions and 16 deletions

View file

@ -37,13 +37,13 @@ var accounts = NewAccountStore()
// to prevent against incorrect multiple access. // to prevent against incorrect multiple access.
type Account struct { type Account struct {
*wallet.Wallet *wallet.Wallet
mtx sync.RWMutex mtx sync.RWMutex
name string name string
dirty bool dirty bool
fullRescan bool fullRescan bool
NewBlockTxSeqN uint64 NewBlockTxJSONID uint64
SpentOutpointSeqN uint64 SpentOutpointJSONID uint64
UtxoStore struct { UtxoStore struct {
sync.RWMutex sync.RWMutex
dirty bool dirty bool
s tx.UtxoStore s tx.UtxoStore
@ -222,7 +222,7 @@ func (a *Account) ImportWIFPrivateKey(wif, label string,
func (a *Account) Track() { func (a *Account) Track() {
n := <-NewJSONID n := <-NewJSONID
a.mtx.Lock() a.mtx.Lock()
a.NewBlockTxSeqN = n a.NewBlockTxJSONID = n
a.mtx.Unlock() a.mtx.Unlock()
replyHandlers.Lock() replyHandlers.Lock()
@ -234,7 +234,7 @@ func (a *Account) Track() {
n = <-NewJSONID n = <-NewJSONID
a.mtx.Lock() a.mtx.Lock()
a.SpentOutpointSeqN = n a.SpentOutpointJSONID = n
a.mtx.Unlock() a.mtx.Unlock()
replyHandlers.Lock() replyHandlers.Lock()
@ -366,7 +366,7 @@ func (a *Account) ReqNewTxsForAddress(addr string) {
log.Debugf("Requesting notifications of TXs sending to address %v", addr) log.Debugf("Requesting notifications of TXs sending to address %v", addr)
a.mtx.RLock() a.mtx.RLock()
n := a.NewBlockTxSeqN n := a.NewBlockTxJSONID
a.mtx.RUnlock() a.mtx.RUnlock()
cmd := btcws.NewNotifyNewTXsCmd(fmt.Sprintf("btcwallet(%d)", n), cmd := btcws.NewNotifyNewTXsCmd(fmt.Sprintf("btcwallet(%d)", n),
@ -386,7 +386,7 @@ func (a *Account) ReqSpentUtxoNtfn(u *tx.Utxo) {
u.Out.Hash, u.Out.Index) u.Out.Hash, u.Out.Index)
a.mtx.RLock() a.mtx.RLock()
n := a.SpentOutpointSeqN n := a.SpentOutpointJSONID
a.mtx.RUnlock() a.mtx.RUnlock()
cmd := btcws.NewNotifySpentCmd(fmt.Sprintf("btcwallet(%d)", n), cmd := btcws.NewNotifySpentCmd(fmt.Sprintf("btcwallet(%d)", n),

View file

@ -801,10 +801,10 @@ func CreateEncryptedWallet(frontend chan []byte, icmd btcjson.Cmd) {
// Create new account with the wallet. A new JSON ID is set for // Create new account with the wallet. A new JSON ID is set for
// transaction notifications. // transaction notifications.
a := &Account{ a := &Account{
Wallet: wlt, Wallet: wlt,
name: cmd.Account, name: cmd.Account,
dirty: true, dirty: true,
NewBlockTxSeqN: <-NewJSONID, NewBlockTxJSONID: <-NewJSONID,
} }
// Begin tracking account against a connected btcd. // Begin tracking account against a connected btcd.
@ -869,7 +869,7 @@ func WalletLock(frontend chan []byte, icmd btcjson.Cmd) {
ReplySuccess(frontend, icmd.Id(), nil) ReplySuccess(frontend, icmd.Id(), nil)
NotifyWalletLockStateChange("", true) NotifyWalletLockStateChange("", true)
} else { } else {
ReplyError(frontend, cmd.Id(), ReplyError(frontend, icmd.Id(),
&btcjson.ErrWalletInvalidAccountName) &btcjson.ErrWalletInvalidAccountName)
} }
} }