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

[Refactor] Remove GetInputAge and GetMasternodeInputAge #1833

Merged
merged 3 commits into from
Sep 7, 2020

Conversation

random-zebra
Copy link

@random-zebra random-zebra commented Sep 2, 2020

Introduce a GetCoinDepth() utility function in CCoinsViewCache and use that instead (with pcoinsTip... no need to lock/load the mempool too in the backend).
This should fix the invalid lock order:

2020-09-02 10:23:17 POTENTIAL DEADLOCK DETECTED
2020-09-02 10:23:17 Previous lock order was:
2020-09-02 10:23:17  cs_process_message /src/masternodeman.cpp:690 (in thread pivx-msghand)
2020-09-02 10:23:17  (1) mempool.cs /src/main.cpp:777 (in thread pivx-msghand)
2020-09-02 10:23:17  (2) cs_main /src/main.cpp:785 (in thread pivx-msghand)
2020-09-02 10:23:17 Current lock order is:
2020-09-02 10:23:17  (2) cs_main /src/main.cpp:4571 (in thread )
2020-09-02 10:23:17  (1) cs /src/txmempool.cpp:590 (in thread )

To be able to use the new per-txout interface, this is based on top of:

The present PR starts with [Refactoring] Add GetCoinDepth utility function to CCoinsViewCache (294e177)

BONUS: remove the cached "ages" saved/serialized in CMasternode class... no comment.

furszy
furszy previously approved these changes Sep 2, 2020
Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

Strong ACK 2be200d ☕ with a refactor comment.

src/coins.cpp Show resolved Hide resolved
@random-zebra
Copy link
Author

Rebased on master and squashed the name change.

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

utACK cf7003b

@furszy
Copy link

furszy commented Sep 7, 2020

extra: tested with 1829 and all good. Merging..

@furszy furszy merged commit 9c06e5d into PIVX-Project:master Sep 7, 2020
@random-zebra random-zebra added this to the 4.3.0 milestone Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants