minor fixes.

This commit is contained in:
Christopher Jeffrey 2015-12-30 14:34:16 -08:00
parent 350ca9c875
commit 3625a4f4c9
2 changed files with 3 additions and 3 deletions

View File

@ -560,7 +560,7 @@ script.execute = function execute(s, stack, tx, index, recurse) {
n = new bn(0);
switch (o) {
case 'add':
n = n1.add(b2);
n = n1.add(n2);
break;
case 'sub':
n = n1.sub(n2);

View File

@ -852,10 +852,10 @@ TX.prototype.getConfirmations = function getConfirmations(chain) {
if (!chain)
return 0;
top = chain.index.heights[chain.index.heights.length - 1];
top = chain.getHeight(chain.index.hashes[chain.index.hashes.length - 1]);
height = this.getHeight(chain);
if (height === -1)
if (top === -1 || height === -1)
return 0;
return top - height + 1;