-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: stop events listener when postage contract is paused #4748
Conversation
pkg/node/node.go
Outdated
|
||
paused, err := stakingContract.Paused(ctx) | ||
if paused && err == nil { | ||
logger.Info("Staking contract is paused.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing err handling from the Paused() call
Also if the contract is paused, then the node should not start, so an error must be returned here
title should be postage contract |
pkg/postage/listener/listener.go
Outdated
@@ -172,6 +174,9 @@ func (l *listener) processEvent(e types.Log, updater postage.EventUpdater) error | |||
c.Price, | |||
e.TxHash, | |||
) | |||
case l.pausedTopic: | |||
l.logger.Warning("Staking contract is paused.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
Checklist
Description
Stop events listener when staking contract is paused