Skip to content

Commit

Permalink
does not import ledger identity in 'wallet:multisig:dkg:create'
Browse files Browse the repository at this point in the history
we don't need to import the identity from the Ledger device into the walletDB
unless and until we finish creating the account.

removes the call to 'wallet/multisig/importParticipant' in
'wallet:multisig:dkg:create' command
  • Loading branch information
hughy committed Feb 10, 2025
1 parent a88b156 commit 07c8439
Showing 1 changed file with 10 additions and 28 deletions.
38 changes: 10 additions & 28 deletions ironfish-cli/src/commands/wallet/multisig/dkg/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,38 +235,20 @@ export class DkgCreateCommand extends IronfishCommand {
identity: string
name: string
}> {
const identities = await client.wallet.multisig.getIdentities()

if (ledger) {
const ledgerIdentity = await ui.ledger({
ledger,
message: 'Getting Ledger Identity',
action: () => ledger.dkgGetIdentity(0),
})

const foundIdentity = identities.content.identities.find(
(i) => i.identity === ledgerIdentity.toString('hex'),
)

if (foundIdentity) {
this.debug('Identity from ledger already exists')
return foundIdentity
}

// We must use the ledger's identity
while (identities.content.identities.find((i) => i.name === name)) {
this.log('An identity with the same name already exists')
name = await ui.inputPrompt('Enter a new name for the identity', true)
}

const created = await client.wallet.multisig.importParticipant({
name,
identity: ledgerIdentity.toString('hex'),
})
const ledgerIdentity = (
await ui.ledger({
ledger,
message: 'Getting Ledger Identity',
action: () => ledger.dkgGetIdentity(0),
})
).toString('hex')

return { name, identity: created.content.identity }
return { name, identity: ledgerIdentity }
}

const identities = await client.wallet.multisig.getIdentities()

const foundIdentity = identities.content.identities.find((i) => i.name === name)

if (foundIdentity) {
Expand Down

0 comments on commit 07c8439

Please sign in to comment.