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

add ImportBlocks #7

Merged
merged 2 commits into from
Sep 3, 2018
Merged

add ImportBlocks #7

merged 2 commits into from
Sep 3, 2018

Conversation

erikzhang
Copy link
Member

@erikzhang erikzhang commented Sep 1, 2018

@vncoelho You can add MaxImportHeight logic to this plugin.

After that, we can remove the import block function from neo-cli and neo-gui.

@vncoelho
Copy link
Member

vncoelho commented Sep 1, 2018

Nice idea, @erikzhang. Great insight. It will proportionate more use cases and better portability.
I learned several small things on this plugin journey.

How should be done? After being merged we edit on top?
I think that it would be:

  • the settings.cs file with:
    • public uint MaxOnImportHeight { get; }
    • and this.MaxOnImportHeight = (uint)GetValueOrDefault(section.GetSection("MaxOnImportHeight"), 0, p => int.Parse(p));
    • The function below inside the ImportBlocks.cs and, probably, being called at GetBlocks:
         public bool CheckMaxOnImportHeight(uint currentImportBlockIndex)
        {
	    if(Settings.Default.MaxOnImportHeight != 0 && Settings.Default.MaxOnImportHeight == currentImportBlockIndex)
		return true;
	    return false;
        }
  • an additional config.json file with: "MaxOnImportHeight": 0

@erikzhang erikzhang merged commit d304434 into master Sep 3, 2018
@erikzhang erikzhang deleted the feature/ImportBlocks branch September 3, 2018 08:16
chenzhitong referenced this pull request in chenzhitong/neo-modules Oct 13, 2020
superboyiii added a commit to ZhangTao1596/neo-modules that referenced this pull request Jan 26, 2021
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.

2 participants