mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Revert deadlock fix in ProcessGetData
Fix was introdeced in: https://github.com/dashpay/dash/pull/1169 A fix was later applied to fix a race condition: https://github.com/dashpay/dash/pull/1178 This has to be reverted to be able to backport multiple changes from Bitcoin. Later backported PRs from Bitcoin will remove cs_mapRelay and thus also remove the deadlock that was initially fixed with the above PRs.
This commit is contained in:
parent
d8c5a59005
commit
2dc71e8e08
@ -884,19 +884,14 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
|
||||
{
|
||||
// Send stream from relay memory
|
||||
bool pushed = false;
|
||||
{
|
||||
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
|
||||
{
|
||||
LOCK(cs_mapRelay);
|
||||
map<CInv, CDataStream>::iterator mi = mapRelay.find(inv);
|
||||
if (mi != mapRelay.end()) {
|
||||
ss += (*mi).second;
|
||||
pfrom->PushMessage(inv.GetCommand(), (*mi).second);
|
||||
pushed = true;
|
||||
}
|
||||
}
|
||||
if(pushed)
|
||||
connman.PushMessage(pfrom, inv.GetCommand(), ss);
|
||||
}
|
||||
|
||||
if (!pushed && inv.type == MSG_TX) {
|
||||
CTransaction tx;
|
||||
|
Loading…
Reference in New Issue
Block a user