Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Erik Jansen
crown-core-test-new-gitlab-runner
Commits
beda3fc9
Commit
beda3fc9
authored
9 years ago
by
UdjinM6
Browse files
Options
Download
Email Patches
Plain Diff
more trylock+wait: rpc, GetHeight
parent
177125ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.cpp
+5
-2
src/main.cpp
src/rpcserver.cpp
+11
-2
src/rpcserver.cpp
with
16 additions
and
4 deletions
+16
-4
src/main.cpp
View file @
beda3fc9
...
...
@@ -302,8 +302,11 @@ CNodeState *State(NodeId pnode) {
int GetHeight()
{
LOCK(cs_main);
return chainActive.Height();
while(true){
TRY_LOCK(cs_main, lockMain);
if(!lockMain) { MilliSleep(10); continue; }
return chainActive.Height();
}
}
void UpdatePreferredDownload(CNode* node, CNodeState* state)
...
...
This diff is collapsed.
Click to expand it.
src/rpcserver.cpp
View file @
beda3fc9
...
...
@@ -1017,8 +1017,17 @@ json_spirit::Value CRPCTable::execute(const std::string &strMethod, const json_s
LOCK
(
cs_main
);
result
=
pcmd
->
actor
(
params
,
false
);
}
else
{
LOCK2
(
cs_main
,
pwalletMain
->
cs_wallet
);
result
=
pcmd
->
actor
(
params
,
false
);
while
(
true
)
{
TRY_LOCK
(
cs_main
,
lockMain
);
if
(
!
lockMain
)
{
MilliSleep
(
50
);
continue
;
}
while
(
true
)
{
TRY_LOCK
(
pwalletMain
->
cs_wallet
,
lockWallet
);
if
(
!
lockMain
)
{
MilliSleep
(
50
);
continue
;
}
result
=
pcmd
->
actor
(
params
,
false
);
break
;
}
break
;
}
}
#else // ENABLE_WALLET
else
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment