From 943e4977bca81c1990037c15607024ea3d36a488 Mon Sep 17 00:00:00 2001 From: Johnathan Howell Date: Thu, 25 May 2017 14:53:18 -0400 Subject: [PATCH] fallback to console output if opening the UI fails --- README.md | 1 + main.go | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 817f330..68a8e3e 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ sia-coldstorage is a utility that generates a seed and a collection of addresses for a Sia wallet, without the blockchain. This is useful for creating 'cold wallets'; you can run this utility on an airgapped machine, write down the seed and the addresses, and send coins safely to any of the addresses without having to worry about malware stealing your coins. You can use Sia to restore the seed and spend the funds at a later date. + ## LICENSE The MIT License (MIT) diff --git a/main.go b/main.go index 37ec36f..61c7479 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "html/template" "log" "net" @@ -28,7 +29,7 @@ const outputTmpl = ` text-align: center; } .info { - margin-top: 25px; + margin-top: 75px; } @@ -97,5 +98,13 @@ func main() { }) go http.Serve(l, handler) - open.Run("http://localhost:8087") + err = open.Run("http://localhost:8087") + if err != nil { + // fallback to console. + fmt.Println("Seed:", seedStr) + fmt.Println("Addresses:") + for _, address := range addresses { + fmt.Println(address) + } + } }