Fixed a few routes.

This commit is contained in:
Chris Kleeschulte 2017-09-26 19:40:25 -04:00
parent 3c4aff4027
commit 2726c7eb86
No known key found for this signature in database
GPG Key ID: 33195D27EF6BDB7F
2 changed files with 16 additions and 7 deletions

View File

@ -128,7 +128,7 @@ BlockService.prototype.getBlockOverview = function(hash, callback) {
height: header.height,
chainWork: header.chainwork,
prevHash: header.prevHash,
nextHash: null,
nextHash: header.nextHash,
merkleRoot: header.merkleRoot,
time: block.ts,
medianTime: null,

View File

@ -50,15 +50,15 @@ TransactionService.prototype.getDetailedTransaction = function(txid, options, ca
return callback();
}
self._header.getBlockHeader(tx.__height, function(err, hash) {
self._header.getBlockHeader(tx.__height, function(err, header) {
if (err) {
return callback(err);
}
assert(hash, 'Tx must have a hash entry in header db for given height.');
assert(header, 'Tx must have a header entry in header db for given height.');
tx.__blockhash = hash;
tx.__blockhash = header.hash;
callback(null, tx);
@ -168,9 +168,18 @@ TransactionService.prototype._getMempoolTransaction = function(txid, tx, options
return callback(null, tx, options);
}
tx.confirmations = 0;
tx.blockHash = null;
callback(null, tx, options);
self._getInputValues(tx, options, function(err, inputValues) {
if (err) {
return callback(err);
}
tx.__inputValues = inputValues;
tx.confirmations = 0;
tx.blockHash = null;
callback(null, tx, options);
});
});