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.
This commit is contained in:
parent
df3779f780
commit
b55a9ed7ca
2 changed files with 5 additions and 5 deletions
|
@ -99,9 +99,9 @@ var ErrNonPositiveAmount = errors.New("amount is not positive")
|
||||||
// negative.
|
// negative.
|
||||||
var ErrNegativeFee = errors.New("fee is 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.
|
// measured in satoshis) added to transactions requiring a fee.
|
||||||
const defaultFeeIncrement = 10000
|
const defaultFeeIncrement = 1e3
|
||||||
|
|
||||||
type CreatedTx struct {
|
type CreatedTx struct {
|
||||||
tx *btcutil.Tx
|
tx *btcutil.Tx
|
||||||
|
|
|
@ -93,14 +93,14 @@ func TestCreateTx(t *testing.T) {
|
||||||
|
|
||||||
// Given the input (15e6 + 10e6 + 1e7) and requested output (15e6 + 10e6)
|
// 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
|
// amounts in the new TX, we should have a change output with 8.99e6, which
|
||||||
// implies a fee of 1e4 satoshis.
|
// implies a fee of 1e3 satoshis.
|
||||||
expectedChange := btcutil.Amount(8.99e6)
|
expectedChange := btcutil.Amount(8.999e6)
|
||||||
|
|
||||||
outputs[changeAddr.String()] = expectedChange
|
outputs[changeAddr.String()] = expectedChange
|
||||||
checkOutputsMatch(t, msgTx, outputs)
|
checkOutputsMatch(t, msgTx, outputs)
|
||||||
|
|
||||||
minFee := feeForSize(defaultFeeIncrement, msgTx.SerializeSize())
|
minFee := feeForSize(defaultFeeIncrement, msgTx.SerializeSize())
|
||||||
actualFee := btcutil.Amount(1e4)
|
actualFee := btcutil.Amount(1e3)
|
||||||
if minFee > actualFee {
|
if minFee > actualFee {
|
||||||
t.Fatalf("Requested fee (%v) for tx size higher than actual fee (%v)", minFee, actualFee)
|
t.Fatalf("Requested fee (%v) for tx size higher than actual fee (%v)", minFee, actualFee)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue