Fix network connection:

+ inbound connection GET_HASHES fix
This commit is contained in:
romanman 2014-12-14 17:01:23 +01:00
parent e8eaa4f6f9
commit c271346a4f
1 changed files with 2 additions and 1 deletions

View File

@ -67,8 +67,9 @@ public class BlockStore {
if (block == null) return hashes; if (block == null) return hashes;
List<byte[]> result = sessionFactory.getCurrentSession(). List<byte[]> result = sessionFactory.getCurrentSession().
createQuery("from BlockVO.hash where number >= :number"). createQuery("select hash from BlockVO where number <= :number and number >= :limit order by number desc").
setParameter("number", block.getNumber()). setParameter("number", block.getNumber()).
setParameter("limit", block.getNumber() - qty).
setMaxResults(qty).list(); setMaxResults(qty).list();
for (byte[] h : result){ for (byte[] h : result){