Add gettxout and gettxoutsetinfo RPCs

This commit is contained in:
Pieter Wuille
2012-09-25 23:04:54 +02:00
parent e1bfbab802
commit beeb57610c
7 changed files with 120 additions and 2 deletions

View File

@@ -1791,6 +1791,16 @@ public:
extern CTxMemPool mempool;
struct CCoinsStats
{
int nHeight;
uint64 nTransactions;
uint64 nTransactionOutputs;
uint64 nSerializedSize;
CCoinsStats() : nHeight(0), nTransactions(0), nTransactionOutputs(0), nSerializedSize(0) {}
};
/** Abstract view on the open txout dataset. */
class CCoinsView
{
@@ -1811,6 +1821,7 @@ public:
// Modify the currently active block index
virtual bool SetBestBlock(CBlockIndex *pindex);
virtual bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockIndex *pindex);
virtual bool GetStats(CCoinsStats &stats);
};
/** CCoinsView backed by another CCoinsView */
@@ -1828,6 +1839,7 @@ public:
bool SetBestBlock(CBlockIndex *pindex);
void SetBackend(CCoinsView &viewIn);
bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockIndex *pindex);
bool GetStats(CCoinsStats &stats);
};
/** CCoinsView that adds a memory cache for transactions to another CCoinsView */