Skip to content
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

Prevent comments and proposals submission when anchoring #1966

Merged

Conversation

tiagoalvesdulce
Copy link
Member

@tiagoalvesdulce tiagoalvesdulce commented Jun 1, 2020

This PR adds the isAnchoring function and prevents proposals and comments submission during a given time (default to 06:58 UTC and 10 minutes).

Solution description

My solution is a simple diff between the current time and the target time and check if its greater than 0 and less than the set duration time.

Depends on decred/politeia#1205

Copy link
Member

@victorgcramos victorgcramos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tiagoalvesdulce thanks for the PR! LGTM! Just left one inline observation!

src/helpers.js Outdated
return timeDiffMinutes >= 0 && timeDiffMinutes < anchoringDuration;
};

isAnchoring();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you calling this here? Any specific reason? If so, could you please leave a comment here referencing the method you are using? Thanks a lot!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was for testing purposes and I forgot to remove it. Thanks for noticing :)

@tiagoalvesdulce tiagoalvesdulce merged commit f401dc6 into decred:master Jun 2, 2020
Copy link
Member

@thi4go thi4go left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM mate! Good job

@tiagoalvesdulce tiagoalvesdulce deleted the blockProposalsAndComments branch June 10, 2020 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants