http: fix block by height.
This commit is contained in:
parent
f0bc6d5925
commit
df4c8cc68c
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user