Replace CCoins-based CTxMemPool::pruneSpent with isSpent

This commit is contained in:
Pieter Wuille
2017-04-25 11:29:37 -07:00
parent 05293f3cb7
commit 13870b56fc
4 changed files with 5 additions and 14 deletions

View File

@@ -513,8 +513,7 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
uint256 hash = vOutPoints[i].hash;
bool hit = false;
if (view.GetCoins(hash, coins)) {
mempool.pruneSpent(hash, coins);
if (coins.IsAvailable(vOutPoints[i].n)) {
if (coins.IsAvailable(vOutPoints[i].n) && !mempool.isSpent(vOutPoints[i])) {
hit = true;
// Safe to index into vout here because IsAvailable checked if it's off the end of the array, or if
// n is valid but points to an already spent output (IsNull).