Browse Source

Merge pull request #446 from gre/fix-standard-fee

fix bitcoin fees to use Standard by default
master
Meriadec Pillet 7 years ago
committed by GitHub
parent
commit
841d1212cc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/components/FeesField/BitcoinKind.js

5
src/components/FeesField/BitcoinKind.js

@ -37,6 +37,7 @@ const blockCountNameConvention = {
'3': 'Standard', // (normal confirmation)', '3': 'Standard', // (normal confirmation)',
'6': 'Low', // (slow confirmation)', '6': 'Low', // (slow confirmation)',
} }
const defaultBlockCount = 3
const customItem = { const customItem = {
label: 'Custom', label: 'Custom',
@ -86,7 +87,9 @@ class FeesField extends Component<
const { items, isFocused } = this.state const { items, isFocused } = this.state
if (fees && !feePerByte && !isFocused) { if (fees && !feePerByte && !isFocused) {
// initialize with the median // initialize with the median
onChange(items[Math.floor(items.length / 2)].feePerByte) const feePerByte = (items.find(item => item.blockCount === defaultBlockCount) || items[0])
.feePerByte
onChange(feePerByte)
} }
} }

Loading…
Cancel
Save