Skip to content

Commit

Permalink
wallet: use brhash for http after param
Browse files Browse the repository at this point in the history
  • Loading branch information
braydonf committed Dec 20, 2018
1 parent ff01a4a commit 6d6718e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/wallet/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -768,10 +768,7 @@ class HTTP extends Server {
const reverse = valid.bool('reverse', false);
const limit = valid.u32('limit', 100);

// TODO consider using brhash and accepting the
// `tx.txid()` vs. `tx.hash()`. This may include adding
// the `tx.txid()` to the results in `toDetails()`.
const after = valid.bhash('after');
const after = valid.brhash('after');
const time = valid.u32('time');

enforce(limit <= 100, 'Limit above max of 100.');
Expand All @@ -780,7 +777,7 @@ class HTTP extends Server {

if (after) {
txs = await req.wallet.listHistoryAfter(acct, {
txid: after.reverse(),
txid: after,
limit,
reverse
});
Expand Down Expand Up @@ -813,7 +810,7 @@ class HTTP extends Server {
const acct = valid.str('account');
const reverse = valid.bool('reverse');
const limit = valid.u32('limit');
const after = valid.bhash('after');
const after = valid.brhash('after');
const time = valid.u32('time');

enforce(limit <= 100, 'Limit above max of 100.');
Expand All @@ -822,7 +819,7 @@ class HTTP extends Server {

if (after) {
txs = await req.wallet.listUnconfirmedAfter(acct, {
txid: after.reverse(),
txid: after,
limit,
reverse
});
Expand Down

0 comments on commit 6d6718e

Please sign in to comment.