From 4589d602127ca9f791b7631a7401ae49a9abc811 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sun, 11 Jan 2015 14:43:25 -0600 Subject: [PATCH] Don't treat nulldata tx outs as nonstandard dust. This commit modifies the dust check to exclude transactions with nulldata outputs so they may be considered standard. --- mempool.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mempool.go b/mempool.go index 21b3571a..4baf31da 100644 --- a/mempool.go +++ b/mempool.go @@ -286,7 +286,7 @@ func checkTransactionStandard(tx *btcutil.Tx, height int64) error { } // None of the output public key scripts can be a non-standard script or - // be "dust". + // be "dust" (except when the script is a null data script). numNullDataOutputs := 0 for i, txOut := range msgTx.TxOut { scriptClass := btcscript.GetScriptClass(txOut.PkScript) @@ -303,12 +303,12 @@ func checkTransactionStandard(tx *btcutil.Tx, height int64) error { return txRuleError(rejectCode, str) } - // Accumulate the number of outputs which only carry data. + // Accumulate the number of outputs which only carry data. For + // all other script types, ensure the output value is not + // "dust". if scriptClass == btcscript.NullDataTy { numNullDataOutputs++ - } - - if isDust(txOut) { + } else if isDust(txOut) { str := fmt.Sprintf("transaction output %d: payment "+ "of %d is dust", i, txOut.Value) return txRuleError(btcwire.RejectDust, str)