wallet: wip sign
This commit is contained in:
parent
458e606359
commit
471a78b0fa
@ -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.
|
||||
};
|
||||
|
||||
@ -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 : [];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user