wallet: Remove unused wallet configurations (#5789)

This commit is contained in:
Chris Stewart 2024-11-26 15:20:13 -06:00 committed by GitHub
parent e852b11dbc
commit dbdad48413
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 1 additions and 74 deletions

View File

@ -139,8 +139,6 @@ bitcoin-s {
wallet {
purpose = segwit # legacy, segwit, nested-segwit
bloomFalsePositiveRate = 0.0001 # percentage
addressGapLimit = 100
discoveryBatchSize = 100
@ -152,14 +150,6 @@ bitcoin-s {
# Copied the same value as Bitcoin Core
longTermFeeRate = 10
# How big the address queue size is before we throw an exception
# because of an overflow
addressQueueSize = 10
# How long we attempt to generate an address for
# before we timeout
addressQueueTimeout = 5 seconds
# Allow external payout and change addresses in DLCs
# By default all DLC addresses are generated by the wallet itself
allowExternalDLCAddresses = false

View File

@ -258,8 +258,6 @@ bitcoin-s {
purpose = segwit # legacy, segwit, nested-segwit, taproot
bloomFalsePositiveRate = 0.0001 # percentage
# the number of consecutive addresses that we do not
# discover funds in before we mark as rescan as exhausted
# this is needed because we can never truely tell how many addresses
@ -276,14 +274,6 @@ bitcoin-s {
# Expected average fee rate over the long term
# in satoshis per virtual byte
longTermFeeRate = 10
# How big the address queue size is before we throw an exception
# because of an overflow
addressQueueSize = 10
# How long we attempt to generate an address for
# before we timeout
addressQueueTimeout = 5 seconds
# Allow external payout and change addresses in DLCs
# By default all DLC addresses are generated by the wallet itself

View File

@ -14,18 +14,4 @@ not ever received funds.
Third, there is `getAddress`. This function takes in an `AccountDb`, `HDChainType`,
and an `Int`. This will return the address associated with the pubkey at
the resulting `BIP32Path`.
## Address Queue
The Bitcoin-S wallet uses a background thread meant to ensure safety when fetching addresses.
This is to ensure independent calls to getNewAddress don't result in a race condition to the database that would generate the same address and cause an error.
With this background thread, we poll the `addressRequestQueue` seeing if there are any elements in it, if there are, we process them and complete the Promise in the queue.
There are two ways to configure the wallet's address queue.
1. `addressQueueSize`: How big the address queue size is before we throw an overflow exception
2. `addressQueueTimeout`: How long we attempt to generate an address for before it times out
For an example configuration, checkout the [example config](../config/configuration.md#example-configuration-file).
the resulting `BIP32Path`.

View File

@ -104,22 +104,12 @@ bitcoin-s {
wallet {
defaultAccountType = taproot # legacy, segwit, nested-segwit, taproot
bloomFalsePositiveRate = 0.0001 # percentage
addressGapLimit = 20
discoveryBatchSize = 100
requiredConfirmations = 6
# How big the address queue size is before we throw an exception
# because of an overflow
addressQueueSize = 10
# How long we attempt to generate an address for
# before we timeout
addressQueueTimeout = 5 seconds
# this config key is read by Slick
db {
name = walletdb

View File

@ -124,9 +124,6 @@ case class WalletAppConfig(
)
}
lazy val bloomFalsePositiveRate: Double =
config.getDouble("bitcoin-s.wallet.bloomFalsePositiveRate")
lazy val addressGapLimit: Int =
config.getInt("bitcoin-s.wallet.addressGapLimit")
@ -274,32 +271,6 @@ case class WalletAppConfig(
def kmParams: KeyManagerParams =
KeyManagerParams(kmConf.seedPath, defaultPurpose, network)
/** How much elements we can have in
* [[org.bitcoins.wallet.internal.AddressHandling.addressRequestQueue]]
* before we throw an exception
*/
def addressQueueSize: Int = {
if (config.hasPath("bitcoin-s.wallet.addressQueueSize")) {
config.getInt("bitcoin-s.wallet.addressQueueSize")
} else {
100
}
}
/** How long we wait while generating an address in
* [[org.bitcoins.wallet.internal.AddressHandling.addressRequestQueue]]
* before we timeout
*/
def addressQueueTimeout: Duration = {
if (config.hasPath("bitcoin-s.wallet.addressQueueTimeout")) {
val javaDuration =
config.getDuration("bitcoin-s.wallet.addressQueueTimeout")
new FiniteDuration(javaDuration.toNanos, TimeUnit.NANOSECONDS)
} else {
5.second
}
}
/** Checks if the following exist
* 1. A seed exists 2. wallet exists 3. The account exists
*/