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 fixes for staking (from marmara experience) #478

Open
dimxy opened this issue Aug 17, 2021 · 0 comments
Open

add fixes for staking (from marmara experience) #478

dimxy opened this issue Aug 17, 2021 · 0 comments

Comments

@dimxy
Copy link
Collaborator

dimxy commented Aug 17, 2021

there are several fixes made in marmara repo but have not yet been pulled into komodo.

  1. static struct komodo_staking *array in komodo_staked() has a c++ CScript object, which destructor is not called when array element is deallocated with free(). Suggestion is to convert it to std::vector which calls destructors for elements and use its reserve() method instead of realloc()
  2. in GenerateBitcoins() when mining/staking threads are interrupted they are not joined so 2 staking threads might be running thus overwriting the static struct komodo_staking *array. To prevent this it is suggested to add join() call after minerThreads->interrupt_all(); Also it is better to store struct komodo_staking *array as thread_local memory to guarantee non overriding it by several threads.
  3. add boost::this_thread::interruption_point(); in the while loop in komodo_waituntilelegible() to allow earlier stop at requests.
    (see marmara repo for those changes)
  4. remove marmara remains in komodo_bitcoind.h/cpp
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

No branches or pull requests

1 participant