Skip to content

Commit 06d2fd7

Browse files
authored
does not import ledger identity in 'wallet:multisig:dkg:create' (#5725)
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
1 parent 95e0eb2 commit 06d2fd7

File tree

1 file changed

+10
-28
lines changed
  • ironfish-cli/src/commands/wallet/multisig/dkg

1 file changed

+10
-28
lines changed

ironfish-cli/src/commands/wallet/multisig/dkg/create.ts

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -235,38 +235,20 @@ export class DkgCreateCommand extends IronfishCommand {
235235
identity: string
236236
name: string
237237
}> {
238-
const identities = await client.wallet.multisig.getIdentities()
239-
240238
if (ledger) {
241-
const ledgerIdentity = await ui.ledger({
242-
ledger,
243-
message: 'Getting Ledger Identity',
244-
action: () => ledger.dkgGetIdentity(0),
245-
})
246-
247-
const foundIdentity = identities.content.identities.find(
248-
(i) => i.identity === ledgerIdentity.toString('hex'),
249-
)
250-
251-
if (foundIdentity) {
252-
this.debug('Identity from ledger already exists')
253-
return foundIdentity
254-
}
255-
256-
// We must use the ledger's identity
257-
while (identities.content.identities.find((i) => i.name === name)) {
258-
this.log('An identity with the same name already exists')
259-
name = await ui.inputPrompt('Enter a new name for the identity', true)
260-
}
261-
262-
const created = await client.wallet.multisig.importParticipant({
263-
name,
264-
identity: ledgerIdentity.toString('hex'),
265-
})
239+
const ledgerIdentity = (
240+
await ui.ledger({
241+
ledger,
242+
message: 'Getting Ledger Identity',
243+
action: () => ledger.dkgGetIdentity(0),
244+
})
245+
).toString('hex')
266246

267-
return { name, identity: created.content.identity }
247+
return { name, identity: ledgerIdentity }
268248
}
269249

250+
const identities = await client.wallet.multisig.getIdentities()
251+
270252
const foundIdentity = identities.content.identities.find((i) => i.name === name)
271253

272254
if (foundIdentity) {

0 commit comments

Comments
 (0)