- currentIndex := uint64(0)
- if rawIndexBytes := m.store.GetAccountIndex(account.XPubs); rawIndexBytes != nil {
- currentIndex = common.BytesToUnit64(rawIndexBytes)
- }
+ currentIndex := m.store.GetAccountIndex(account.XPubs)
- if rawIndexBytes := m.store.GetAccountIndex(xpubs); rawIndexBytes != nil {
- acctIndex = common.BytesToUnit64(rawIndexBytes) + 1
+ if currentIndex := m.store.GetAccountIndex(xpubs); currentIndex != 0 {
+ acctIndex = currentIndex + 1
}
account, err := CreateAccount(xpubs, quorum, alias, acctIndex, deriveRule)
if err != nil {
}
account, err := CreateAccount(xpubs, quorum, alias, acctIndex, deriveRule)
if err != nil {