Skip to content

Commit

Permalink
Fix TransactionRange
Browse files Browse the repository at this point in the history
  • Loading branch information
hkalodner committed May 8, 2018
1 parent e37efb5 commit a89e976
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions include/blocksci/chain/blockchain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,12 @@ namespace blocksci {

DataAccess &getAccess() { return access; }

uint32_t firstTxIndex() const;
uint32_t endTxIndex() const;
uint32_t firstTxIndex() {
return 0;
}
uint32_t endTxIndex() {
return Block(lastBlockHeight - 1, access).endTxIndex();
}

uint32_t size() const {
return static_cast<uint32_t>(lastBlockHeight);
Expand Down
4 changes: 2 additions & 2 deletions include/blocksci/chain/transaction_range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ namespace blocksci {
currentTxPos += sizeof(RawTransaction) +
static_cast<size_t>(tx->inputCount) * sizeof(Inout) +
static_cast<size_t>(tx->outputCount) * sizeof(Inout);
--currentTxIndex;
++currentTxIndex;
if (currentTxIndex == nextBlockFirst) {
--blockNum;
++blockNum;
updateNextBlock();
}
}
Expand Down

0 comments on commit a89e976

Please sign in to comment.