http: fix block by height.

This commit is contained in:
Christopher Jeffrey 2017-05-14 15:29:20 -07:00
parent f0bc6d5925
commit df4c8cc68c
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -274,7 +274,11 @@ HTTPServer.prototype.initRouter = function initRouter() {
'Hash or height required.');
enforce(!this.chain.options.spv, 'Cannot get block in SPV mode.');
hash = util.revHex(hash);
if (hash.length === 64)
hash = util.revHex(hash);
else
hash = +hash;
block = yield this.chain.db.getBlock(hash);
if (!block) {