Skip to content

Commit 70f6049

Browse files
committed
Remove CTxDB::ReadOwnerTxes.
It seems it wasn't ever used since 0.1.5.
1 parent 703db97 commit 70f6049

File tree

2 files changed

+0
-61
lines changed

2 files changed

+0
-61
lines changed

src/db.cpp

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -404,66 +404,6 @@ bool CTxDB::ContainsTx(uint256 hash)
404404
return Exists(make_pair(string("tx"), hash));
405405
}
406406

407-
bool CTxDB::ReadOwnerTxes(uint160 hash160, int nMinHeight, vector<CTransaction>& vtx)
408-
{
409-
assert(!fClient);
410-
vtx.clear();
411-
412-
// Get cursor
413-
Dbc* pcursor = GetCursor();
414-
if (!pcursor)
415-
return false;
416-
417-
unsigned int fFlags = DB_SET_RANGE;
418-
loop
419-
{
420-
// Read next record
421-
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
422-
if (fFlags == DB_SET_RANGE)
423-
ssKey << string("owner") << hash160 << CDiskTxPos(0, 0, 0);
424-
CDataStream ssValue(SER_DISK, CLIENT_VERSION);
425-
int ret = ReadAtCursor(pcursor, ssKey, ssValue, fFlags);
426-
fFlags = DB_NEXT;
427-
if (ret == DB_NOTFOUND)
428-
break;
429-
else if (ret != 0)
430-
{
431-
pcursor->close();
432-
return false;
433-
}
434-
435-
// Unserialize
436-
string strType;
437-
uint160 hashItem;
438-
CDiskTxPos pos;
439-
int nItemHeight;
440-
441-
try {
442-
ssKey >> strType >> hashItem >> pos;
443-
ssValue >> nItemHeight;
444-
}
445-
catch (std::exception &e) {
446-
return error("%s() : deserialize error", __PRETTY_FUNCTION__);
447-
}
448-
449-
// Read transaction
450-
if (strType != "owner" || hashItem != hash160)
451-
break;
452-
if (nItemHeight >= nMinHeight)
453-
{
454-
vtx.resize(vtx.size()+1);
455-
if (!vtx.back().ReadFromDisk(pos))
456-
{
457-
pcursor->close();
458-
return false;
459-
}
460-
}
461-
}
462-
463-
pcursor->close();
464-
return true;
465-
}
466-
467407
bool CTxDB::ReadDiskTx(uint256 hash, CTransaction& tx, CTxIndex& txindex)
468408
{
469409
assert(!fClient);

src/db.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ class CTxDB : public CDB
307307
bool AddTxIndex(const CTransaction& tx, const CDiskTxPos& pos, int nHeight);
308308
bool EraseTxIndex(const CTransaction& tx);
309309
bool ContainsTx(uint256 hash);
310-
bool ReadOwnerTxes(uint160 hash160, int nHeight, std::vector<CTransaction>& vtx);
311310
bool ReadDiskTx(uint256 hash, CTransaction& tx, CTxIndex& txindex);
312311
bool ReadDiskTx(uint256 hash, CTransaction& tx);
313312
bool ReadDiskTx(COutPoint outpoint, CTransaction& tx, CTxIndex& txindex);

0 commit comments

Comments
 (0)