From 2f86f323c03eaea1be2523a4833a1e089cf18652 Mon Sep 17 00:00:00 2001 From: eordano Date: Tue, 24 Feb 2015 16:22:41 -0300 Subject: [PATCH] Add link when throwing a serialization error --- docs/transaction.md | 2 +- lib/transaction/transaction.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/transaction.md b/docs/transaction.md index e8851b3..c7efa6c 100644 --- a/docs/transaction.md +++ b/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 diff --git a/lib/transaction/transaction.js b/lib/transaction/transaction.js index de7c4b8..165486f 100644 --- a/lib/transaction/transaction.js +++ b/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();