-
Notifications
You must be signed in to change notification settings - Fork 725
[Wallet] Speedup coinstake creation removing redundancies. #1817
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
[Wallet] Speedup coinstake creation removing redundancies. #1817
Conversation
bc0e56f to
4f5329c
Compare
random-zebra
left a comment
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.
nice cleanup 👍 utACK 4f5329c6a5fa63a77ed3145fa73faf274a6c20f6
Fuzzbawls
left a comment
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.
ACK 4f5329c6a5fa63a77ed3145fa73faf274a6c20f6
|
Needs rebase |
The usage of unique_ptr on this context is just wrong, same as the double for loop over all of the available outputs.
4f5329c to
9fb497d
Compare
|
rebased |
random-zebra
left a comment
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.
re-utACK 9fb497d and merging...
261bd22 Staking process: calculate the stakeable utxo only once. (furszy) Pull request description: Work on top of #1816 and part of #1817 coinstake transaction creation speedup goal. Starting on 01814d5 Improving the following situation: we are calculating the stakeable utxo twice for the same PoS block creation process (looping over the entire wallet's transactions map twice), one before calling `CreateNewBlock` in `CheckForCoins` and the second one inside the `CreateNewBlock` method when we call `CWallet::CreateCoinStake`. This PR fixes it adding an unique available coins vector calculated before the block creation, only once per try, in the `CheckForCoins` function and feeding `CreateNewBlock` with it. ACKs for top commit: random-zebra: utACK 261bd22 Tree-SHA512: f553667fd48d0d7eb78e2ce87b438c915dc216b32e0426e0214caa52f16a2627143319233c6dd93e4b5d45dcfbb825787c1b39cd209c8e6516bf2391f0516e00
Improvement over the coinstake transaction creation flow, it will speed up the process a lot.
Removing a for loop redundancy (it was looping over the available outputs twice), removing a simply bad usage of unique_ptr, guarding
chainActiveaccess, removing unused zPoS code and few smaller warnings fixes.