Browse Source

Add link when throwing a serialization error

patch-2
eordano 10 years ago
parent
commit
2f86f323c0
  1. 2
      docs/transaction.md
  2. 2
      lib/transaction/transaction.js

2
docs/transaction.md

@ -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

2
lib/transaction/transaction.js

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

Loading…
Cancel
Save