Skip to content

Commit f9d167a

Browse files
committed
show error when confirmation subroutine dies
1 parent 8e5a978 commit f9d167a

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

pkg/coordinator/wallet/manager.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"crypto/ecdsa"
66
"errors"
7+
"runtime/debug"
78
"sync"
89
"time"
910

@@ -66,6 +67,16 @@ func (manager *Manager) GetWalletByAddress(address common.Address) *Wallet {
6667
}
6768

6869
func (manager *Manager) runBlockTransactionsLoop() {
70+
defer func() {
71+
if err := recover(); err != nil {
72+
manager.logger.WithError(err.(error)).Panicf("uncaught panic in wallet.Manager.runBlockTransactionsLoop: %v, stack: %v", err, string(debug.Stack()))
73+
74+
time.Sleep(10 * time.Second)
75+
76+
go manager.runBlockTransactionsLoop()
77+
}
78+
}()
79+
6980
blockSubscription := manager.clientPool.GetBlockCache().SubscribeBlockEvent(10)
7081
defer blockSubscription.Unsubscribe()
7182

0 commit comments

Comments
 (0)