-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation for Electrum's full_scan/sync #1494
Add documentation for Electrum's full_scan/sync #1494
Conversation
|
Thanks for the initiative on this, better docs are always better. |
To clarify, this means that txs spending to your wallet from a foreign wallet will not have the input info and so you can't calculate the fee without |
Thanks guys! I'll update the PR shortly. |
82efbc1
to
0bd2643
Compare
This is what I ended up adding: /// - `fetch_prev_txouts`: specifies whether we want previous `TxOut`s for fee calculation.
/// Note that this requires additional calls to the Electrum server, but
/// is necessary for calculating the fee on a transaction if your wallet
/// does not own the inputs. Methods like [`Wallet.calculate_fee`] and
/// [`Wallet.calculate_fee_rate`] will return a
/// [`CalculateFeeError::MissingTxOut`] error if those `TxOut`s are not
/// present in the transaction graph. |
0bd2643
to
215f469
Compare
4dd92a6
to
96e0d27
Compare
Rebased and ready to go. |
96e0d27
to
056f26c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 056f26c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 056f26c
ACK 056f26c |
056f26c
to
7b5657e
Compare
Rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-ACK 7b5657e
This PR also serves as an issue; it can't really be merged as is. I just didn't want to open an issue and just ask for better docs and instead decided to open a PR with some unfinished new API docs.
I am working on a page for the Book of BDK that focuses on bdk_wallet + bdk_electrum syncing. A few things have been unclear to me, and I think slight additions to the API docs would fix that for others.
1. I was wondering what exactly thisEdit: this is no longer a type after the rebase.confirmation_time
field on thebdk_chain::ConfirmationTimeHeightAnchor
type represents. After digging into it (at least for the electrum client), it represents the timestamp specified by the block header where the tx was confirmed. Question: I'd like to confirm that this always the case, e.g. that this is the timestamp used in cases where your client is an Esplora or bitcoind RPC node? If so, my addition to the sentence will make sense and is ready to go.2. I think it'd be great to add context to the
fetch_prev_txouts
argument on the full_scan and sync methods on theBdkElectrumClient
. It says that this is necessary for "fee calculation". What does that mean? I assume it means "for calculating the fee rate on the given transactions"? (let me know if that's wrong). Even so, I'm left wondering what happens if I don't fetch them. Will my fee calculations be just plain wrong? Or will they be unavailable? A bit more context for the caller of the method would be great here. If someone knows the definite answer to this let me know and feel free to propose a doc line and I'll amend the commit!Checklists
cargo fmt
andcargo clippy
before committing