From 03d328ff3c6a04c4d7f9f94c3218aa45a1be726a Mon Sep 17 00:00:00 2001 From: davvd Date: Tue, 5 Dec 2023 06:54:05 +0300 Subject: [PATCH] extra check --- lib/zold/commands/create.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/zold/commands/create.rb b/lib/zold/commands/create.rb index 51abfbd7..6682fabe 100644 --- a/lib/zold/commands/create.rb +++ b/lib/zold/commands/create.rb @@ -87,6 +87,7 @@ def create_id(opts) def create(id, opts) key = Zold::Key.new(file: opts['public-key']) @wallets.acq(id, exclusive: true) do |wallet| + raise "Wallet #{id} already exists" if wallet.exists? wallet.init(id, key, network: opts['network']) @log.debug("Wallet #{Rainbow(wallet).green} created at #{@wallets.path}") end