Add link when throwing a serialization error

This commit is contained in:
eordano 2015-02-24 16:22:41 -03:00
parent 97671abfdc
commit 2f86f323c0
2 changed files with 3 additions and 1 deletions

View File

@ -161,7 +161,7 @@ These are the current default values in the Bitcore library involved on these ch
* `Transaction.FEE_PER_KB`: `10000` (satoshis per kilobyte)
* `Transaction.FEE_SECURITY_MARGIN`: `15`
* `Transaction.DUST_AMOUNT`: 5460 (satoshis)
* `Transaction.DUST_AMOUNT`: `5460` (satoshis)
## Fee calculation

View File

@ -153,6 +153,8 @@ Transaction.prototype.uncheckedSerialize = Transaction.prototype.toString = func
Transaction.prototype.checkedSerialize = function(opts) {
var serializationError = this.getSerializationError(opts);
if (serializationError) {
serializationError.message += ' Use Transaction#uncheckedSerialize if you want to skip security checks. ' +
'See http://bitcore.io/guide/transaction.html#Serialization for more info.'
throw serializationError;
}
return this.uncheckedSerialize();