Skip to content

Commit

Permalink
Ignore size of proof in results data. Don't allow client to set highe…
Browse files Browse the repository at this point in the history
…r max results.
  • Loading branch information
fireduck64 committed Aug 22, 2018
1 parent 554c7a0 commit 2117bbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/src/trie/HashedTrie.java
Expand Up @@ -131,7 +131,7 @@ public void getNodeDetails(ByteString hash, ByteString target_key, LinkedList<Tr
{
results.add(node);
}
if (results.size() + proof.size() >= max_results) return;
if (results.size() >= max_results) return;


for(ChildEntry ce : node.getChildrenList())
Expand Down
2 changes: 1 addition & 1 deletion node/src/SnowUserService.java
Expand Up @@ -182,7 +182,7 @@ public void getUTXONode(GetUTXONodeRequest request, StreamObserver<GetUTXONodeRe
LinkedList<TrieNode> proof = new LinkedList<>();
LinkedList<TrieNode> results = new LinkedList<>();
int max_results = 10000;
if (request.getMaxResults() > 0) max_results = request.getMaxResults();
if (request.getMaxResults() > 0) max_results = Math.min(max_results, request.getMaxResults());


node.getUtxoHashedTrie().getNodeDetails(utxo_root.getBytes(), target, proof, results, max_results);
Expand Down

0 comments on commit 2117bbc

Please sign in to comment.