Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
feat: add transactionTimeHash to getTransactions
Browse files Browse the repository at this point in the history
  • Loading branch information
gjgd committed Dec 18, 2019
1 parent bf151a8 commit 886f9f8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/element-lib/src/sidetree-v2/protocol/getTransactions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
const getTransactions = sidetree => async () => {
const getTransactions = sidetree => async ({ transactionTimeHash } = {}) => {
let since = 0;
let end = 'latest';
if (transactionTimeHash) {
const blockchainTime = await sidetree.blockchain.getBlockchainTime(transactionTimeHash);
since = blockchainTime.time;
end = since + 1;
}
const transactions = await sidetree.blockchain.getTransactions(
0,
'latest',
since,
end,
{ omitTimestamp: true },
);
// Only get the last 20 transactions to avoid crashing the page
Expand Down

0 comments on commit 886f9f8

Please sign in to comment.