mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-13 11:35:40 +01:00
Docs: Address Queue (#1776)
* Docs: Address Queue * docs: add configuration options
This commit is contained in:
parent
0bf0655335
commit
d52c78d37a
1 changed files with 14 additions and 0 deletions
|
@ -15,3 +15,17 @@ 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).
|
||||
|
|
Loading…
Add table
Reference in a new issue