Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/transaction/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,13 @@ Transaction.prototype.fromObject = function fromObject(arg) {

Transaction.prototype._checkConsistency = function(arg) {
if (!_.isUndefined(this._changeIndex)) {
$.checkState(this._changeScript);
$.checkState(this.outputs[this._changeIndex]);
$.checkState(this._changeScript, 'Change script is expected.');
$.checkState(this.outputs[this._changeIndex], 'Change index points to undefined output.');
$.checkState(this.outputs[this._changeIndex].script.toString() ===
this._changeScript.toString());
this._changeScript.toString(), 'Change output has an unexpected script.');
}
if (arg && arg.hash) {
$.checkState(arg.hash === this.hash, 'Hash in object does not match transaction hash');
$.checkState(arg.hash === this.hash, 'Hash in object does not match transaction hash.');
}
};

Expand Down Expand Up @@ -1050,7 +1050,7 @@ Transaction.prototype.removeInput = function(txId, outputIndex) {
* @return {Transaction} this, for chaining
*/
Transaction.prototype.sign = function(privateKey, sigtype) {
$.checkState(this.hasAllUtxoInfo());
$.checkState(this.hasAllUtxoInfo(), 'Not all utxo information is available to sign the transaction.');
var self = this;
if (_.isArray(privateKey)) {
_.each(privateKey, function(privateKey) {
Expand Down