aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-06-20 15:07:41 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2012-06-20 15:07:48 +0200
commit70f6049f713a7c8b0672d573b8222b70b6912631 (patch)
tree2bbb06ba29616088a326e5cd443908e9bf384ac5 /src/db.cpp
parent703db97d80ea21a44ed74c8bbbaf1430c5e0dd37 (diff)
Remove CTxDB::ReadOwnerTxes.
It seems it wasn't ever used since 0.1.5.
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/db.cpp b/src/db.cpp
index 4f4e1d84b7..ecdf32a8f0 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -404,66 +404,6 @@ bool CTxDB::ContainsTx(uint256 hash)
return Exists(make_pair(string("tx"), hash));
}
-bool CTxDB::ReadOwnerTxes(uint160 hash160, int nMinHeight, vector<CTransaction>& vtx)
-{
- assert(!fClient);
- vtx.clear();
-
- // Get cursor
- Dbc* pcursor = GetCursor();
- if (!pcursor)
- return false;
-
- unsigned int fFlags = DB_SET_RANGE;
- loop
- {
- // Read next record
- CDataStream ssKey(SER_DISK, CLIENT_VERSION);
- if (fFlags == DB_SET_RANGE)
- ssKey << string("owner") << hash160 << CDiskTxPos(0, 0, 0);
- CDataStream ssValue(SER_DISK, CLIENT_VERSION);
- int ret = ReadAtCursor(pcursor, ssKey, ssValue, fFlags);
- fFlags = DB_NEXT;
- if (ret == DB_NOTFOUND)
- break;
- else if (ret != 0)
- {
- pcursor->close();
- return false;
- }
-
- // Unserialize
- string strType;
- uint160 hashItem;
- CDiskTxPos pos;
- int nItemHeight;
-
- try {
- ssKey >> strType >> hashItem >> pos;
- ssValue >> nItemHeight;
- }
- catch (std::exception &e) {
- return error("%s() : deserialize error", __PRETTY_FUNCTION__);
- }
-
- // Read transaction
- if (strType != "owner" || hashItem != hash160)
- break;
- if (nItemHeight >= nMinHeight)
- {
- vtx.resize(vtx.size()+1);
- if (!vtx.back().ReadFromDisk(pos))
- {
- pcursor->close();
- return false;
- }
- }
- }
-
- pcursor->close();
- return true;
-}
-
bool CTxDB::ReadDiskTx(uint256 hash, CTransaction& tx, CTxIndex& txindex)
{
assert(!fClient);