@@ -404,66 +404,6 @@ bool CTxDB::ContainsTx(uint256 hash)
404
404
return Exists (make_pair (string (" tx" ), hash));
405
405
}
406
406
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
-
467
407
bool CTxDB::ReadDiskTx (uint256 hash, CTransaction& tx, CTxIndex& txindex)
468
408
{
469
409
assert (!fClient );
0 commit comments