Skip to content

Commit 482d342

Browse files
jholdstockjrick
authored andcommitted
Increment correct account branch.
Ensure SyncLastReturnedAddress RPC increments the correct account branch when the caller specifies the external branch. Also fix the func name used for errors/logging while this area is being touched.
1 parent 4317fc3 commit 482d342

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

wallet/addresses.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2017-2025 The Decred developers
1+
// Copyright (c) 2017-2026 The Decred developers
22
// Use of this source code is governed by an ISC
33
// license that can be found in the LICENSE file.
44

@@ -843,7 +843,7 @@ func (w *Wallet) BIP0044BranchNextIndexes(ctx context.Context, account uint32) (
843843
// BIP00044 account branch. The next returned address for the branch will be
844844
// child+1.
845845
func (w *Wallet) SyncLastReturnedAddress(ctx context.Context, account, branch, child uint32) error {
846-
const op errors.Op = "wallet.ExtendWatchedAddresses"
846+
const op errors.Op = "wallet.SyncLastReturnedAddress"
847847

848848
var (
849849
branchXpub *hdkeychain.ExtendedKey
@@ -860,7 +860,7 @@ func (w *Wallet) SyncLastReturnedAddress(ctx context.Context, account, branch, c
860860
var alb *addressBuffer
861861
switch branch {
862862
case udb.ExternalBranch:
863-
alb = &acctData.albInternal
863+
alb = &acctData.albExternal
864864
case udb.InternalBranch:
865865
alb = &acctData.albInternal
866866
default:

0 commit comments

Comments
 (0)