Catch and log panic in blockbook main
parent
c4487ac94b
commit
d5f11561ac
|
@ -347,7 +347,7 @@ func TestUnpackTx(t *testing.T) {
|
|||
func TestDeriveAddressDescriptorsFromTo(t *testing.T) {
|
||||
|
||||
parser := NewNulsParser(GetChainParams("main"), &btc.Configuration{})
|
||||
|
||||
|
||||
// test xpub xprv math ,and get private key
|
||||
xprv := "xprv9yEvwSfPanK5gLYVnYvNyF2CEWJx1RsktQtKDeT6jnCnqASBiPCvFYHFSApXv39bZbF6hRaha1kWQBVhN1xjo7NHuhAn5uUfzy79TBuGiHh"
|
||||
xpub := "xpub6CEHLxCHR9sNtpcxtaTPLNxvnY9SQtbcFdov22riJ7jmhxmLFvXAoLbjHSzwXwNNuxC1jUP6tsHzFV9rhW9YKELfmR9pJaKFaM8C3zMPgjw"
|
||||
|
|
|
@ -31,7 +31,7 @@ func NewRitocoinRPC(config json.RawMessage, pushHandler func(bchain.Notification
|
|||
|
||||
// Initialize initializes RitocoinRPC instance.
|
||||
func (b *RitocoinRPC) Initialize() error {
|
||||
ci, err := b.GetChainInfo()
|
||||
ci, err := b.GetChainInfo()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import (
|
|||
_ "net/http/pprof"
|
||||
"os"
|
||||
"os/signal"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"syscall"
|
||||
|
@ -105,6 +106,13 @@ func init() {
|
|||
}
|
||||
|
||||
func main() {
|
||||
defer func() {
|
||||
if e := recover(); e != nil {
|
||||
glog.Error("main recovered from panic: ", e)
|
||||
debug.PrintStack()
|
||||
os.Exit(-1)
|
||||
}
|
||||
}()
|
||||
os.Exit(mainWithExitCode())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue