Merge pull request #202 from devlo/master

Bug fix for #199
This commit is contained in:
Manuel Aráoz 2014-09-29 11:24:29 -03:00
commit 52a3949315

View File

@ -335,7 +335,7 @@ BlockDb.prototype._fillConfirmationsOneSpent = function(o, chainHeight, cb) {
o.spentTxId = oi.spentTxId;
o.index = oi.index;
o.spentIsConfirmed = chainHeight >= height;
o.spentConfirmations = chainHeight - height;
o.spentConfirmations = chainHeight - height +1;
}
return e_c();
});
@ -345,7 +345,7 @@ BlockDb.prototype._fillConfirmationsOneSpent = function(o, chainHeight, cb) {
if (err) return cb(err);
if (height >=0 ) {
o.spentIsConfirmed = chainHeight >= height;
o.spentConfirmations = chainHeight - height;
o.spentConfirmations = chainHeight - height +1;
}
return cb();
});
@ -358,7 +358,7 @@ BlockDb.prototype._fillConfirmationsOne = function(o, chainHeight, cb) {
if (err) return cb(err);
if (height>=0) {
o.isConfirmed = chainHeight >= height;
o.confirmations = chainHeight - height;
o.confirmations = chainHeight - height +1;
return self._fillConfirmationsOneSpent(o,chainHeight,cb);
}
else return cb();