From 5ec9ce65e157362cb8a2a8d233ac97b0e5401645 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sun, 5 Nov 2017 20:16:26 -0800 Subject: [PATCH] do not create an empty config file when rpc is down or we have the wrong user/pass --- lib/Hush/List.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Hush/List.pm b/lib/Hush/List.pm index e44d323..672ad27 100644 --- a/lib/Hush/List.pm +++ b/lib/Hush/List.pm @@ -53,7 +53,6 @@ sub _sanity_checks { sub create_default_conf { my ($list_conf) = @_; my $time = time; - open my $fh, ">", $list_conf or die "Could not write file $list_conf ! : $!"; # when we create a brand new conf, we create brand new funding+nym addrs my $rpc = Hush::RPC->new; @@ -63,6 +62,7 @@ sub create_default_conf { my $pseudonym_taddr = $rpc->getnewaddress; die "Unable to create pseudonym taddr" unless $pseudonym_taddr; + open my $fh, ">", $list_conf or die "Could not write file $list_conf ! : $!"; print $fh "# hushlist config v$Hush::List::VERSION\n"; print $fh "funding_zaddr=$funding_zaddr\n"; print $fh "pseudonym_taddr=$pseudonym_taddr\n";