wallet: wip sign

This commit is contained in:
Fedor Indutny 2014-05-05 01:58:48 +04:00
parent 458e606359
commit 471a78b0fa
2 changed files with 11 additions and 2 deletions

View File

@ -104,3 +104,12 @@ TX.prototype.out = function out(output, value) {
return this;
};
TX.prototype.getSubscript = function getSubscript(index) {
var input = this.inputs[index];
assert(input);
var script = input.script;
for (var i = 0; input.script.
};

View File

@ -75,8 +75,8 @@ Wallet.prototype.sign = function sign(tx, type) {
// Add signature script to each input
inputs.forEach(function(input, i) {
var copy = input.tx.clone();
var s = input.out.tx.getSubscript();
var copy = tx.clone();
var s = input.out.tx.getSubscript(input.out.index);
copy.inputs.forEach(function(input, j) {
input.script = i === j ? s : [];