Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Fetch balances of multiple ETH accounts at the same time, instead of one by one.
- Fix wrong btc/ltc transaction timestamp during header sync
- Ethereum bugfix: show all internal transactions that share the same transaction ID
- Allow up to 6 unused BTC/LTC accounts (previously 5)

## v4.48.4
- macOS: fix potential USB communication issue with BitBox02 bootloaders <v1.1.2 and firmwares <v9.23.1
Expand Down
11 changes: 6 additions & 5 deletions backend/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const hardenedKeystart uint32 = hdkeychain.HardenedKeyStart
// useful in recovery, so we can scan a fixed number of accounts to discover all funds. The
// alternative (or a complement) would be an accounts gap limit, similar to Bitcoin's address gap
// limit, but simply use a hard limit for simplicity.
const accountsHardLimit = 5
const accountsHardLimit = 6

// AccountsList is an accounts.Interface slice which implements a lookup method.
type AccountsList []accounts.Interface
Expand Down Expand Up @@ -1609,11 +1609,12 @@ func (backend *Backend) maybeAddHiddenUnusedAccounts() {
// Account scan gap limit:
// - Previous account must be used for the next one to be scanned, but:
// - The first 5 accounts are always scanned as before we had accounts discovery, the
// BitBoxApp allowed manual creation of 5 accounts, so we need to always scan these.
if maxAccount == nil || maxAccount.Used || maxAccountNumber < accountsHardLimit {
// BitBoxApp allowed manual creation of 5 accounts, so we need to always scan these
nextAccountNumber := maxAccountNumber + 1
if maxAccount == nil || maxAccount.Used || nextAccountNumber < accountsHardLimit {
accountCode, err := backend.createAndPersistAccountConfig(
coinCode,
uint16(maxAccountNumber+1),
uint16(nextAccountNumber),
true,
"",
backend.keystore,
Expand All @@ -1626,7 +1627,7 @@ func (backend *Backend) maybeAddHiddenUnusedAccounts() {
}
log.
WithField("accountCode", accountCode).
WithField("accountNumber", maxAccountNumber+1).
WithField("accountNumber", nextAccountNumber).
Info("automatically created hidden account")
return &accountCode
}
Expand Down
2 changes: 1 addition & 1 deletion backend/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func TestNextAccountNumber(t *testing.T) {
signing.NewBitcoinConfiguration(
signing.ScriptTypeP2WPKH,
rootFingerprint2,
mustKeypath("m/84'/0'/4'"),
mustKeypath("m/84'/0'/5'"),
xpub,
),
},
Expand Down