txdb: fix confirmations.

This commit is contained in:
Christopher Jeffrey 2016-10-24 16:27:27 -07:00
parent 926d9cb5aa
commit 842ba5f5b6
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -3164,7 +3164,12 @@ Details.prototype.setOutput = function setOutput(i, path) {
*/
Details.prototype.getConfirmations = function getConfirmations() {
var depth = this.chainHeight - this.height;
var depth;
if (this.height === -1)
return 0;
depth = this.chainHeight - this.height;
if (depth < 0)
return 0;