horrible last resort to lookup txes.

This commit is contained in:
Christopher Jeffrey 2014-12-10 11:04:24 -08:00
parent 3528221f86
commit 4ae8ddc5bb
1 changed files with 18 additions and 0 deletions

View File

@ -5878,6 +5878,24 @@ get_tx(uint256 txid, uint256& blockhash, CTransaction& ctx) {
}
}
}
#if 0
// NOTE: Using -txindex would prevent this.
int64_t i = 0;
int64_t height = chainActive.Height();
for (; i <= height; i++) {
CBlock block;
CBlockIndex* pblockindex = chainActive[i];
if (ReadBlockFromDisk(block, pblockindex)) {
BOOST_FOREACH(const CTransaction& tx, block.vtx) {
if (tx.GetHash() == txid) {
ctx = tx;
blockhash = block.GetHash();
return -2;
}
}
}
}
#endif
return 0;
}