|
|
@ -84,10 +84,10 @@ function sighash(transaction, sighashType, inputNumber, subscript) { |
|
|
|
.write(txcopy.toBuffer()) |
|
|
|
.writeInt32LE(sighashType) |
|
|
|
.toBuffer(); |
|
|
|
console.log('actual:'); |
|
|
|
console.log(buf.toString('hex')); |
|
|
|
console.log('expected:'); |
|
|
|
console.log('01000000019ce5586f04dd407719ab7e2ed3583583b9022f29652702cfac5ed082013461fe0000000043410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8acffffffff010000000000000000000000000001000000'); |
|
|
|
//console.log('actual:');
|
|
|
|
//console.log(buf.toString('hex'));
|
|
|
|
//console.log('expected:');
|
|
|
|
//console.log('01000000019ce5586f04dd407719ab7e2ed3583583b9022f29652702cfac5ed082013461fe0000000043410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8acffffffff010000000000000000000000000001000000');
|
|
|
|
return BufferReader(Hash.sha256sha256(buf)).readReverse(); |
|
|
|
} |
|
|
|
|
|
|
@ -100,7 +100,6 @@ function sign(transaction, keypair, nhashtype, nin, subscript) { |
|
|
|
|
|
|
|
function verify(transaction, sig, pubkey, nin, subscript) { |
|
|
|
var hashbuf = sighash(transaction, sig.nhashtype, nin, subscript); |
|
|
|
hashbuf = new BufferReader(hashbuf).readReverse(); |
|
|
|
console.log('actual:'); |
|
|
|
console.log(hashbuf.toString('hex')); |
|
|
|
console.log('expected:'); |
|
|
|