Skip to content

Commit

Permalink
temp comm
Browse files Browse the repository at this point in the history
  • Loading branch information
someone235 committed Feb 6, 2024
1 parent 6b38bf7 commit 5d4a081
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions cmd/kaspawallet/daemon/server/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (s *server) ShowAddresses(_ context.Context, request *pb.ShowAddressesReque
return nil, errors.Errorf("wallet daemon is not synced yet, %s", s.formatSyncStateReport())
}

addresses := make([]string, s.keysFile.LastUsedExternalIndex())
addresses := make([]string, 0, s.keysFile.LastUsedExternalIndex()+s.keysFile.LastUsedInternalIndex())
for i := uint32(1); i <= s.keysFile.LastUsedExternalIndex(); i++ {
walletAddr := &walletAddress{
index: i,
Expand All @@ -65,7 +65,21 @@ func (s *server) ShowAddresses(_ context.Context, request *pb.ShowAddressesReque
if err != nil {
return nil, err
}
addresses[i-1] = address.String()
addresses = append(addresses, address.String())
}

for i := uint32(1); i <= s.keysFile.LastUsedInternalIndex(); i++ {
walletAddr := &walletAddress{
index: i,
cosignerIndex: s.keysFile.CosignerIndex,
keyChain: libkaspawallet.InternalKeychain,
}
path := s.walletAddressPath(walletAddr)
address, err := libkaspawallet.Address(s.params, s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, path, s.keysFile.ECDSA)
if err != nil {
return nil, err
}
addresses = append(addresses, address.String())
}

return &pb.ShowAddressesResponse{Address: addresses}, nil
Expand Down

0 comments on commit 5d4a081

Please sign in to comment.