conformal/btcwallet — pull request #139 by tuxcanfly (2014-10-14 11:39:15+00:00)
Title: panic when btcd connection fails and chainSvr is nil

For example, when an invalid CA file is passed:

btcwallet --simnet --cafile=abc

and the file is not found, `chainSvr` is `nil`, resulting in a panic

16:27:51 2014-10-14 [ERR] BTCW: Cannot open CA file: open abc: no such file or directory
16:27:51 2014-10-14 [INF] BTCW: Opened wallet files
panic: runtime error: invalid memory address or nil pointer dereference
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x1 pc=0x806cb13]

goroutine 56 [running]:
runtime.panic(0x84ca040, 0x88d2d93)
/usr/local/go/src/pkg/runtime/panic.c:279 +0xe9
main.func·017()
/home/tuxcanfly/Work/conformal/src/github.com/conformal/btcwallet/wallet.go:449 +0x33
runtime.panic(0x84ca040, 0x88d2d93)
/usr/local/go/src/pkg/runtime/panic.c:248 +0x176
main.(*Wallet).syncWithChain(0x193bad80, 0x0, 0x0)
/home/tuxcanfly/Work/conformal/src/github.com/conformal/btcwallet/wallet.go:464 +0x172
main.func·016()
/home/tuxcanfly/Work/conformal/src/github.com/conformal/btcwallet/wallet.go:373 +0x30
created by main.(*Wallet).Start
/home/tuxcanfly/Work/conformal/src/github.com/conformal/btcwallet/wallet.go:377 +0x213