mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
Merge pull request #6688
131c23d
Fix locking in GetTransaction. (Alex Morcos)
This commit is contained in:
commit
4939eabb75
@ -965,14 +965,13 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
|||||||
bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock, bool fAllowSlow)
|
bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock, bool fAllowSlow)
|
||||||
{
|
{
|
||||||
CBlockIndex *pindexSlow = NULL;
|
CBlockIndex *pindexSlow = NULL;
|
||||||
{
|
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
{
|
|
||||||
if (mempool.lookup(hash, txOut))
|
if (mempool.lookup(hash, txOut))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (fTxIndex) {
|
if (fTxIndex) {
|
||||||
CDiskTxPos postx;
|
CDiskTxPos postx;
|
||||||
@ -1006,7 +1005,6 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock
|
|||||||
if (nHeight > 0)
|
if (nHeight > 0)
|
||||||
pindexSlow = chainActive[nHeight];
|
pindexSlow = chainActive[nHeight];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (pindexSlow) {
|
if (pindexSlow) {
|
||||||
CBlock block;
|
CBlock block;
|
||||||
|
Loading…
Reference in New Issue
Block a user