Added critical section lock in isSpent

This commit is contained in:
Braydon Fuller 2015-10-02 14:09:29 -04:00
parent 76d466b29b
commit 7070d4c74d

View File

@ -1231,6 +1231,8 @@ NAN_METHOD(IsSpent) {
const uint256 txid = uint256S(argStr); const uint256 txid = uint256S(argStr);
int outputIndex = info[1]->IntegerValue(); int outputIndex = info[1]->IntegerValue();
{
LOCK(mempool.cs);
CCoinsView dummy; CCoinsView dummy;
CCoinsViewCache view(&dummy); CCoinsViewCache view(&dummy);
@ -1244,6 +1246,7 @@ NAN_METHOD(IsSpent) {
return; return;
} }
} }
}
info.GetReturnValue().Set(New<Boolean>(true)); info.GetReturnValue().Set(New<Boolean>(true));
}; };