From b55a9ed7ca6cd112d21fd1d08c7b0a986ee74daa Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 15 Dec 2014 21:36:38 -0500 Subject: [PATCH] Drop default tx fee/kB to 0.00001 BTC. This matches the recent change made to bitcoin core wallet, and follows roughly a year after the minimum mempool relay fee/kB was dropped to the same value. --- createtx.go | 4 ++-- createtx_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/createtx.go b/createtx.go index 6d4653b..90ea305 100644 --- a/createtx.go +++ b/createtx.go @@ -99,9 +99,9 @@ var ErrNonPositiveAmount = errors.New("amount is not positive") // negative. var ErrNegativeFee = errors.New("fee is negative") -// defaultFeeIncrement is the default minimum transation fee (0.0001 BTC, +// defaultFeeIncrement is the default minimum transation fee (0.00001 BTC, // measured in satoshis) added to transactions requiring a fee. -const defaultFeeIncrement = 10000 +const defaultFeeIncrement = 1e3 type CreatedTx struct { tx *btcutil.Tx diff --git a/createtx_test.go b/createtx_test.go index 3a0c264..84b15ca 100644 --- a/createtx_test.go +++ b/createtx_test.go @@ -93,14 +93,14 @@ func TestCreateTx(t *testing.T) { // Given the input (15e6 + 10e6 + 1e7) and requested output (15e6 + 10e6) // amounts in the new TX, we should have a change output with 8.99e6, which - // implies a fee of 1e4 satoshis. - expectedChange := btcutil.Amount(8.99e6) + // implies a fee of 1e3 satoshis. + expectedChange := btcutil.Amount(8.999e6) outputs[changeAddr.String()] = expectedChange checkOutputsMatch(t, msgTx, outputs) minFee := feeForSize(defaultFeeIncrement, msgTx.SerializeSize()) - actualFee := btcutil.Amount(1e4) + actualFee := btcutil.Amount(1e3) if minFee > actualFee { t.Fatalf("Requested fee (%v) for tx size higher than actual fee (%v)", minFee, actualFee) }