remove wallet.signEmpty and tx.signature for now.

This commit is contained in:
Christopher Jeffrey 2015-12-05 00:01:59 -08:00
parent c8e04d8552
commit acbe4d0c2e
2 changed files with 0 additions and 43 deletions

View File

@ -235,19 +235,6 @@ TX.prototype.verify = function verify(index, force) {
}, this);
};
TX.prototype.signature = function signature(key, index, sighash) {
if (typeof index !== 'number') {
index = tx.inputs.indexOf(index);
if (index === -1) return;
}
var input = this.inputs[index];
var subscript = input.out.tx.getSubscript(input.out.index);
var hash = this.subscriptHash(input, subscript, sighash);
var signature = bcoin.ecdsa.sign(hash, key).toDER();
signature = signature.concat(bcoin.protocol.constants.hashType[sighash]);
return signature;
};
TX.prototype.isCoinbase = function isCoinbase() {
return this.inputs.length === 1 && +this.inputs[0].out.hash === 0;
};

View File

@ -271,8 +271,6 @@ Wallet.prototype.sign = function sign(tx, type, inputs, off) {
if (!type)
type = 'all';
// assert.equal(type, 'all');
if (!off)
off = 0;
@ -323,34 +321,6 @@ Wallet.prototype.sign = function sign(tx, type, inputs, off) {
return inputs.length;
};
Wallet.prototype.signEmpty = function sign(tx, type, inputs, off) {
if (!type)
type = 'all';
// assert.equal(type, 'all');
if (!off)
off = 0;
var pub = this.getPublicKey();
inputs = inputs || tx.inputs;
// Add signature script to each input
inputs = inputs.filter(function(input, i) {
// Filter inputs that this wallet own
if (!input.out.tx || !this.ownOutput(input.out.tx))
return false;
var signature = [0x30, 0, 0x02, 0, 0, 0x02, 0, 0];
signature = signature.concat(bcoin.protocol.constants.hashType[type]);
input.script = [ signature, pub ];
return true;
}, this);
return inputs.length;
};
Wallet.prototype.addTX = function addTX(tx, block) {
return this.tx.add(tx);
};