Browse Source

Return undefined instead of a null signature

patch-2
Esteban Ordano 10 years ago
parent
commit
ff82ccec71
  1. 4
      lib/transaction/input/multisigscripthash.js
  2. 2
      lib/transaction/unspentoutput.js

4
lib/transaction/input/multisigscripthash.js

@ -43,7 +43,7 @@ MultiSigScriptHashInput.prototype.toObject = function() {
MultiSigScriptHashInput.prototype._deserializeSignatures = function(signatures) {
return _.map(signatures, function(signature) {
if (!signature) {
return signature;
return undefined;
}
return {
publicKey: new PublicKey(signature.publicKey),
@ -59,7 +59,7 @@ MultiSigScriptHashInput.prototype._deserializeSignatures = function(signatures)
MultiSigScriptHashInput.prototype._serializeSignatures = function() {
return _.map(this.signatures, function(signature) {
if (!signature) {
return signature;
return undefined;
}
return {
publicKey: signature.publicKey.toString(),

2
lib/transaction/unspentoutput.js

@ -98,7 +98,7 @@ UnspentOutput.prototype.toJSON = function() {
*/
UnspentOutput.prototype.toObject = function() {
return {
address: this.address.toString(),
address: this.address ? this.address.toString() : undefined,
txid: this.txId,
vout: this.outputIndex,
scriptPubKey: this.script.toBuffer().toString('hex'),

Loading…
Cancel
Save