From 07c8439462b5c835f234d7ed5267b2ec207e033c Mon Sep 17 00:00:00 2001 From: Hugh Cunningham Date: Mon, 10 Feb 2025 14:47:46 -0800 Subject: [PATCH] does not import ledger identity in 'wallet:multisig:dkg:create' 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 --- .../commands/wallet/multisig/dkg/create.ts | 38 +++++-------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/ironfish-cli/src/commands/wallet/multisig/dkg/create.ts b/ironfish-cli/src/commands/wallet/multisig/dkg/create.ts index c291a97c8a..c9389f8243 100644 --- a/ironfish-cli/src/commands/wallet/multisig/dkg/create.ts +++ b/ironfish-cli/src/commands/wallet/multisig/dkg/create.ts @@ -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) {