fixes for script and tx.

This commit is contained in:
Christopher Jeffrey 2016-03-21 05:54:34 -07:00
parent 93efe376a6
commit 59777baf71
2 changed files with 4 additions and 4 deletions

View File

@ -36,7 +36,7 @@ Witness.encode = function encode(witness) {
};
Witness.decode = function decode(buf) {
return bcoin.protocol.parser.parseTX(buf).items;
return bcoin.protocol.parser.parseWitness(buf).witness.items;
};
Witness.prototype.clone = function clone() {

View File

@ -1100,7 +1100,7 @@ TX._fromExtended = function _fromExtended(buf, saveCoins) {
coin = p.readVarBytes();
if (coin.length === 0)
continue;
coin = bcoin.protocol.parser.parseCoin(p, false);
coin = bcoin.protocol.parser.parseCoin(coin, false);
coin.hash = tx.inputs[i].prevout.hash;
coin.index = tx.inputs[i].prevout.index;
coin.spent = false;
@ -1113,8 +1113,8 @@ TX._fromExtended = function _fromExtended(buf, saveCoins) {
return tx;
};
TX.fromExtended = function fromExtended(buf, coins) {
return new TX(TX._fromExtended(buf, coins));
TX.fromExtended = function fromExtended(buf, saveCoins) {
return new TX(TX._fromExtended(buf, saveCoins));
};
/**