Rename some Account variables.
This commit is contained in:
parent
649112b764
commit
57802d8daf
2 changed files with 16 additions and 16 deletions
22
account.go
22
account.go
|
@ -37,13 +37,13 @@ var accounts = NewAccountStore()
|
|||
// to prevent against incorrect multiple access.
|
||||
type Account struct {
|
||||
*wallet.Wallet
|
||||
mtx sync.RWMutex
|
||||
name string
|
||||
dirty bool
|
||||
fullRescan bool
|
||||
NewBlockTxSeqN uint64
|
||||
SpentOutpointSeqN uint64
|
||||
UtxoStore struct {
|
||||
mtx sync.RWMutex
|
||||
name string
|
||||
dirty bool
|
||||
fullRescan bool
|
||||
NewBlockTxJSONID uint64
|
||||
SpentOutpointJSONID uint64
|
||||
UtxoStore struct {
|
||||
sync.RWMutex
|
||||
dirty bool
|
||||
s tx.UtxoStore
|
||||
|
@ -222,7 +222,7 @@ func (a *Account) ImportWIFPrivateKey(wif, label string,
|
|||
func (a *Account) Track() {
|
||||
n := <-NewJSONID
|
||||
a.mtx.Lock()
|
||||
a.NewBlockTxSeqN = n
|
||||
a.NewBlockTxJSONID = n
|
||||
a.mtx.Unlock()
|
||||
|
||||
replyHandlers.Lock()
|
||||
|
@ -234,7 +234,7 @@ func (a *Account) Track() {
|
|||
|
||||
n = <-NewJSONID
|
||||
a.mtx.Lock()
|
||||
a.SpentOutpointSeqN = n
|
||||
a.SpentOutpointJSONID = n
|
||||
a.mtx.Unlock()
|
||||
|
||||
replyHandlers.Lock()
|
||||
|
@ -366,7 +366,7 @@ func (a *Account) ReqNewTxsForAddress(addr string) {
|
|||
log.Debugf("Requesting notifications of TXs sending to address %v", addr)
|
||||
|
||||
a.mtx.RLock()
|
||||
n := a.NewBlockTxSeqN
|
||||
n := a.NewBlockTxJSONID
|
||||
a.mtx.RUnlock()
|
||||
|
||||
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)
|
||||
|
||||
a.mtx.RLock()
|
||||
n := a.SpentOutpointSeqN
|
||||
n := a.SpentOutpointJSONID
|
||||
a.mtx.RUnlock()
|
||||
|
||||
cmd := btcws.NewNotifySpentCmd(fmt.Sprintf("btcwallet(%d)", n),
|
||||
|
|
10
cmdmgr.go
10
cmdmgr.go
|
@ -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
|
||||
// transaction notifications.
|
||||
a := &Account{
|
||||
Wallet: wlt,
|
||||
name: cmd.Account,
|
||||
dirty: true,
|
||||
NewBlockTxSeqN: <-NewJSONID,
|
||||
Wallet: wlt,
|
||||
name: cmd.Account,
|
||||
dirty: true,
|
||||
NewBlockTxJSONID: <-NewJSONID,
|
||||
}
|
||||
|
||||
// Begin tracking account against a connected btcd.
|
||||
|
@ -869,7 +869,7 @@ func WalletLock(frontend chan []byte, icmd btcjson.Cmd) {
|
|||
ReplySuccess(frontend, icmd.Id(), nil)
|
||||
NotifyWalletLockStateChange("", true)
|
||||
} else {
|
||||
ReplyError(frontend, cmd.Id(),
|
||||
ReplyError(frontend, icmd.Id(),
|
||||
&btcjson.ErrWalletInvalidAccountName)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue