{"action":"closed","issue":{"url":"https://api.github.com/repos/piotrnar/gocoin/issues/11","labels_url":"https://api.github.com/repos/piotrnar/gocoin/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/piotrnar/gocoin/issues/11/comments","events_url":"https://api.github.com/repos/piotrnar/gocoin/issues/11/events","html_url":"https://github.com/piotrnar/gocoin/issues/11","id":64712731,"number":11,"title":"[BUG] panic when first time run client. You didn't create dir before Creating empty default wallet","user":{"login":"feeling4t","id":5309938,"avatar_url":"https://avatars.githubusercontent.com/u/5309938?v=3","gravatar_id":"","url":"https://api.github.com/users/feeling4t","html_url":"https://github.com/feeling4t","followers_url":"https://api.github.com/users/feeling4t/followers","following_url":"https://api.github.com/users/feeling4t/following{/other_user}","gists_url":"https://api.github.com/users/feeling4t/gists{/gist_id}","starred_url":"https://api.github.com/users/feeling4t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feeling4t/subscriptions","organizations_url":"https://api.github.com/users/feeling4t/orgs","repos_url":"https://api.github.com/users/feeling4t/repos","events_url":"https://api.github.com/users/feeling4t/events{/privacy}","received_events_url":"https://api.github.com/users/feeling4t/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-27T07:32:06Z","updated_at":"2015-03-27T10:06:03Z","closed_at":"2015-03-27T10:06:03Z","body":"go version go1.3.1 linux/amd64\r\nGocoin client version 1.0.3\r\n\r\n\r\nin client/init.go, line 78~79\r\n\t\t\tfmt.Println(\"Creating empty default wallet at\", default_wallet_fn)\r\n\t\t\tioutil.WriteFile(default_wallet_fn, []byte(fmt.Sprintln(\"# Put your wallet's public addresses here\")), 0660)\r\n\r\nYou didn't make dir before write file. Obviously, ioutil.WriteFile will fail, but you ignore the error.\r\n\r\nfeeling4t@feeling4t-laptop:~/btc/gocoin/client$ ./client -t\r\nGocoin client version 1.0.3\r\nYou seem to be running Gocoin for the fist time on this PC\r\n/home/feeling4t/.bitcoin/gocoin/tstnet/wallet/DEFAULT not found\r\nCreating empty default wallet at /home/feeling4t/.bitcoin/gocoin/tstnet/wallet/DEFAULT\r\nPlace secrets of your stealth keys in /home/feeling4t/.bitcoin/gocoin/tstnet/wallet/stealth/  (use 'arm' to load more)\r\nmain panic recovered: runtime error: invalid memory address or nil pointer dereference\r\n/home/feeling4t/btc/gocoin/client/main.go:250 (0x40709f)\r\n\tfunc.002: fmt.Println(string(debug.Stack()))\r\n/usr/local/go/src/pkg/runtime/panic.c:248 (0x415b6d)\r\n\tpanic: runtime·newstackcall(d->fn, (byte*)d->args, d->siz);\r\n/usr/local/go/src/pkg/runtime/panic.c:552 (0x41661d)\r\n\tpanicstring: runtime·panic(err);\r\n/usr/local/go/src/pkg/runtime/os_linux.c:237 (0x41520e)\r\n\tsigpanic: runtime·panicstring(\"invalid memory address or nil pointer dereference\");\r\n/home/feeling4t/gowork/src/github.com/piotrnar/gocoin/client/wallet/balance.go:517 (0x4a338f)\r\n\tLoadAllWallets: for i := range MyWallet.Addrs {\r\n/home/feeling4t/btc/gocoin/client/init.go:88 (0x401c0f)\r\n\thost_init: wallet.LoadAllWallets()\r\n/home/feeling4t/btc/gocoin/client/main.go:260 (0x406089)\r\n\tmain: host_init() // This will create the DB lock file and keep it open\r\n/usr/local/go/src/pkg/runtime/proc.c:247 (0x417bca)\r\n\tmain: main·main();\r\n/usr/local/go/src/pkg/runtime/proc.c:1445 (0x41a390)\r\n\tgoexit: runtime·goexit(void)\r\n\r\nClosing network\r\n\r\n\r\nmodify it to \r\n\r\n\t\t\tfmt.Println(\"Creating empty default wallet at\", default_wallet_fn)\r\n\t\t\tif err := ioutil.WriteFile(default_wallet_fn, []byte(fmt.Sprintln(\"# Put your wallet's public addresses here\")), 0660); err !=nil {\r\n\t\t\t\tfmt.Println(\"###Create wallet error:\", err)\r\n\t\t\t}else{\r\n\t\t\t\tfmt.Println(\"###Create wallet OK\")\r\n\t\t\t}\r\n\r\nfeeling4t@feeling4t-laptop:~/btc/gocoin/client$ ./client -t\r\nGocoin client version 1.0.3\r\nYou seem to be running Gocoin for the fist time on this PC\r\n/home/feeling4t/.bitcoin/gocoin/tstnet/wallet/DEFAULT not found\r\nCreating empty default wallet at /home/feeling4t/.bitcoin/gocoin/tstnet/wallet/DEFAULT\r\n###Create wallet error: open /home/feeling4t/.bitcoin/gocoin/tstnet/wallet/DEFAULT: no such file or directory\r\nPlace secrets of your stealth keys in /home/feeling4t/.bitcoin/gocoin/tstnet/wallet/stealth/  (use 'arm' to load more)\r\nmain panic recovered: runtime error: invalid memory address or nil pointer dereference\r\n/home/feeling4t/btc/gocoin/client/main.go:250 (0x40709f)\r\n\tfunc.002: fmt.Println(string(debug.Stack()))\r\n/usr/local/go/src/pkg/runtime/panic.c:248 (0x415b6d)\r\n\tpanic: runtime·newstackcall(d->fn, (byte*)d->args, d->siz);\r\n/usr/local/go/src/pkg/runtime/panic.c:552 (0x41661d)\r\n\tpanicstring: runtime·panic(err);\r\n/usr/local/go/src/pkg/runtime/os_linux.c:237 (0x41520e)\r\n\tsigpanic: runtime·panicstring(\"invalid memory address or nil pointer dereference\");\r\n/home/feeling4t/gowork/src/github.com/piotrnar/gocoin/client/wallet/balance.go:517 (0x4a338f)\r\n\tLoadAllWallets: for i := range MyWallet.Addrs {\r\n/home/feeling4t/btc/gocoin/client/init.go:88 (0x401c0f)\r\n\thost_init: wallet.LoadAllWallets()\r\n/home/feeling4t/btc/gocoin/client/main.go:260 (0x406089)\r\n\tmain: host_init() // This will create the DB lock file and keep it open\r\n/usr/local/go/src/pkg/runtime/proc.c:247 (0x417bca)\r\n\tmain: main·main();\r\n/usr/local/go/src/pkg/runtime/proc.c:1445 (0x41a390)\r\n\tgoexit: runtime·goexit(void)\r\n\r\nClosing network\r\n"}}