Skip to content

Commit

Permalink
bugfix: Removed the fatal on panic in access subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
gameofpointers committed Oct 28, 2024
1 parent 3be7932 commit 832c53a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions quai/filters/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (api *PublicFilterAPI) timeoutLoop(timeout time.Duration) {
api.backend.Logger().WithFields(log.Fields{
"error": r,
"stacktrace": string(debug.Stack()),
}).Fatal("Go-Quai Panicked")
}).Error("Go-Quai Panicked")
}
}()
var toUninstall []*Subscription
Expand Down Expand Up @@ -188,7 +188,7 @@ func (api *PublicFilterAPI) NewPendingTransactions(ctx context.Context) (*rpc.Su
api.backend.Logger().WithFields(log.Fields{
"error": r,
"stacktrace": string(debug.Stack()),
}).Fatal("Go-Quai Panicked")
}).Error("Go-Quai Panicked")
}
api.activeSubscriptions -= 1
}()
Expand Down Expand Up @@ -237,7 +237,7 @@ func (api *PublicFilterAPI) NewBlockFilter() rpc.ID {
api.backend.Logger().WithFields(log.Fields{
"error": r,
"stacktrace": string(debug.Stack()),
}).Fatal("Go-Quai Panicked")
}).Error("Go-Quai Panicked")
}
}()
for {
Expand Down Expand Up @@ -279,7 +279,7 @@ func (api *PublicFilterAPI) NewHeads(ctx context.Context) (*rpc.Subscription, er
api.backend.Logger().WithFields(log.Fields{
"error": r,
"stacktrace": string(debug.Stack()),
}).Fatal("Go-Quai Panicked")
}).Error("Go-Quai Panicked")
}
api.activeSubscriptions -= 1
}()
Expand Down Expand Up @@ -329,7 +329,7 @@ func (api *PublicFilterAPI) Accesses(ctx context.Context, addr common.Address) (
api.backend.Logger().WithFields(log.Fields{
"error": r,
"stacktrace": string(debug.Stack()),
}).Fatal("Go-Quai Panicked")
}).Error("Go-Quai Panicked")
}
api.activeSubscriptions -= 1
}()
Expand All @@ -349,7 +349,7 @@ func (api *PublicFilterAPI) Accesses(ctx context.Context, addr common.Address) (
// Check for external accesses
switch tx.Type() {
case types.QuaiTxType:
if tx.To().Equal(addr) || tx.From(nodeLocation).Equal(addr) {
if tx.To() != nil && tx.To().Equal(addr) || tx.From(nodeLocation).Equal(addr) {
notifier.Notify(rpcSub.ID, hash)
break
}
Expand Down Expand Up @@ -428,7 +428,7 @@ func (api *PublicFilterAPI) Logs(ctx context.Context, crit FilterCriteria) (*rpc
api.backend.Logger().WithFields(log.Fields{
"error": r,
"stacktrace": string(debug.Stack()),
}).Fatal("Go-Quai Panicked")
}).Error("Go-Quai Panicked")
}
api.activeSubscriptions -= 1
}()
Expand Down Expand Up @@ -486,7 +486,7 @@ func (api *PublicFilterAPI) NewFilter(crit FilterCriteria) (rpc.ID, error) {
api.backend.Logger().WithFields(log.Fields{
"error": r,
"stacktrace": string(debug.Stack()),
}).Fatal("Go-Quai Panicked")
}).Error("Go-Quai Panicked")
}
}()
for {
Expand Down Expand Up @@ -795,7 +795,7 @@ func (api *PublicFilterAPI) PendingHeader(ctx context.Context) (*rpc.Subscriptio
api.backend.Logger().WithFields(log.Fields{
"error": r,
"stacktrace": string(debug.Stack()),
}).Fatal("Go-Quai Panicked")
}).Error("Go-Quai Panicked")
}
}()
header := make(chan *types.WorkObject, c_pendingHeaderChSize)
Expand All @@ -810,7 +810,7 @@ func (api *PublicFilterAPI) PendingHeader(ctx context.Context) (*rpc.Subscriptio
api.backend.Logger().WithFields(log.Fields{
"error": r,
"stacktrace": string(debug.Stack()),
}).Fatal("Go-Quai Panicked")
}).Error("Go-Quai Panicked")
}
}()
// Marshal the header data
Expand Down
2 changes: 1 addition & 1 deletion quai/filters/filter_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ func (es *EventSystem) eventLoop() {
es.backend.Logger().WithFields(log.Fields{
"error": r,
"stacktrace": string(debug.Stack()),
}).Fatal("Go-Quai Panicked")
}).Error("Go-Quai Panicked")
}
}()
nodeCtx := es.backend.NodeCtx()
Expand Down

0 comments on commit 832c53a

Please sign in to comment.