From d946f5b20dd720d5d7111c9c1e66c7d9c25d36d9 Mon Sep 17 00:00:00 2001 From: jholdstock Date: Fri, 10 Apr 2026 10:40:19 +0800 Subject: [PATCH] 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. --- wallet/addresses.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wallet/addresses.go b/wallet/addresses.go index 6b28bf378..7f7e22347 100644 --- a/wallet/addresses.go +++ b/wallet/addresses.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2025 The Decred developers +// Copyright (c) 2017-2026 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -843,7 +843,7 @@ func (w *Wallet) BIP0044BranchNextIndexes(ctx context.Context, account uint32) ( // BIP00044 account branch. The next returned address for the branch will be // child+1. func (w *Wallet) SyncLastReturnedAddress(ctx context.Context, account, branch, child uint32) error { - const op errors.Op = "wallet.ExtendWatchedAddresses" + const op errors.Op = "wallet.SyncLastReturnedAddress" var ( branchXpub *hdkeychain.ExtendedKey @@ -860,7 +860,7 @@ func (w *Wallet) SyncLastReturnedAddress(ctx context.Context, account, branch, c var alb *addressBuffer switch branch { case udb.ExternalBranch: - alb = &acctData.albInternal + alb = &acctData.albExternal case udb.InternalBranch: alb = &acctData.albInternal default: