Return undefined instead of a null signature

This commit is contained in:
Esteban Ordano 2015-01-08 16:18:20 -03:00
parent dc6ff32290
commit ff82ccec71
2 changed files with 3 additions and 3 deletions

View File

@ -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(),

View File

@ -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'),