Skip to content

Commit

Permalink
Adjust mempool.space fee mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
martinboehm committed Mar 15, 2024
1 parent 9a2fe4d commit b5cfbdf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
16 changes: 8 additions & 8 deletions bchain/coins/btc/mempoolspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,27 +86,27 @@ func (p *mempoolSpaceFeeProvider) mempoolSpaceFeeProcessData(data *mempoolSpaceF
feePerKB: data.FastestFee * 1000,
}

// HalfHourFee is for 2-5 blocks
// HalfHourFee is for 2-6 blocks
p.fees[1] = alternativeFeeProviderFee{
blocks: 5,
blocks: 6,
feePerKB: data.HalfHourFee * 1000,
}

// HourFee is for 6-18 blocks
// HourFee is for 7-36 blocks
p.fees[2] = alternativeFeeProviderFee{
blocks: 18,
blocks: 36,
feePerKB: data.HourFee * 1000,
}

// EconomyFee is for 19-100 blocks
// EconomyFee is for 37-200 blocks
p.fees[3] = alternativeFeeProviderFee{
blocks: 100,
blocks: 500,
feePerKB: data.EconomyFee * 1000,
}

// MinimumFee is for over 100 blocks
// MinimumFee is for over 500 blocks
p.fees[4] = alternativeFeeProviderFee{
blocks: 500,
blocks: 1000,
feePerKB: data.MinimumFee * 1000,
}

Expand Down
14 changes: 10 additions & 4 deletions bchain/coins/btc/mempoolspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ func Test_mempoolSpaceFeeProvider(t *testing.T) {
{1, *big.NewInt(50000)},
{2, *big.NewInt(40000)},
{5, *big.NewInt(40000)},
{6, *big.NewInt(30000)},
{6, *big.NewInt(40000)},
{7, *big.NewInt(30000)},
{10, *big.NewInt(30000)},
{18, *big.NewInt(30000)},
{19, *big.NewInt(20000)},
{19, *big.NewInt(30000)},
{36, *big.NewInt(30000)},
{37, *big.NewInt(20000)},
{100, *big.NewInt(20000)},
{101, *big.NewInt(10000)},
{500, *big.NewInt(10000)},
{101, *big.NewInt(20000)},
{200, *big.NewInt(20000)},
{201, *big.NewInt(20000)},
{500, *big.NewInt(20000)},
{501, *big.NewInt(10000)},
{5000000, *big.NewInt(10000)},
}
for _, tt := range tests {
Expand Down

0 comments on commit b5cfbdf

Please sign in to comment.