mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Convert tree to using univalue. Eliminate all json_spirit uses.
This commit is contained in:
committed by
Jonas Schnelli
parent
5e3060c0d1
commit
15982a8b69
@@ -13,7 +13,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "json/json_spirit_value.h"
|
||||
#include "json_spirit_wrapper.h"
|
||||
|
||||
using namespace json_spirit;
|
||||
using namespace std;
|
||||
@@ -206,7 +206,13 @@ Value getrawmempool(const Array& params, bool fHelp)
|
||||
if (mempool.exists(txin.prevout.hash))
|
||||
setDepends.insert(txin.prevout.hash.ToString());
|
||||
}
|
||||
Array depends(setDepends.begin(), setDepends.end());
|
||||
|
||||
UniValue depends;
|
||||
BOOST_FOREACH(const string& dep, setDepends)
|
||||
{
|
||||
depends.push_back(dep);
|
||||
}
|
||||
|
||||
info.push_back(Pair("depends", depends));
|
||||
o.push_back(Pair(hash.ToString(), info));
|
||||
}
|
||||
@@ -412,14 +418,14 @@ Value gettxout(const Array& params, bool fHelp)
|
||||
LOCK(mempool.cs);
|
||||
CCoinsViewMemPool view(pcoinsTip, mempool);
|
||||
if (!view.GetCoins(hash, coins))
|
||||
return Value::null;
|
||||
return NullUniValue;
|
||||
mempool.pruneSpent(hash, coins); // TODO: this should be done by the CCoinsViewMemPool
|
||||
} else {
|
||||
if (!pcoinsTip->GetCoins(hash, coins))
|
||||
return Value::null;
|
||||
return NullUniValue;
|
||||
}
|
||||
if (n<0 || (unsigned int)n>=coins.vout.size() || coins.vout[n].IsNull())
|
||||
return Value::null;
|
||||
return NullUniValue;
|
||||
|
||||
BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
|
||||
CBlockIndex *pindex = it->second;
|
||||
|
||||
Reference in New Issue
Block a user