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 sleep in batchvote rpc #1810

Merged
merged 7 commits into from
Mar 17, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/masternodes/rpc_proposals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,11 @@ UniValue votegovbatch(const JSONRPCRequest &request) {
execTestTx(CTransaction(rawTx), targetHeight, optAuthTx);

ret.push_back(signsend(rawTx, pwallet, optAuthTx)->GetHash().GetHex());
// Sleep the RPC worker thread a bit, so that the node can
// relay the TXs as it works through. Otherwise, the main
// chain can be locked for too long that prevent broadcasting of
// TXs
std::this_thread::sleep_for(std::chrono::seconds(1));
Copy link
Member

Choose a reason for hiding this comment

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

1 second seems like a long time. Have we tested smaller time periods?

Copy link
Member Author

@prasannavl prasannavl Mar 9, 2023

Choose a reason for hiding this comment

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

Edit: Moved rationale to main thread.

Copy link
Member Author

Choose a reason for hiding this comment

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

Switched to 0.5s in light of the perf. observations data with -walletfastselect

}

return ret;
Expand Down