-
Notifications
You must be signed in to change notification settings - Fork 12
Conversation
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.
Thanks @evanlinjin. Quick review of how bdk core APIs are used. I think it can be simplified quite a bit by changing the API to return last_active_index
.
I would love to see the sync/scan command to have a --live
option where after doing the sync it prints out some basic stuff like balance and utxos maybe and then sits there polling for new blocks and prints out details about new transactions that come in that spend/create new wallet utxos.
Since the codebase is getting more mature now it'd be great if you could add docs and even example usage for new APIs (or even old ones). I find writing an explanation of the API helps me figure out early if the API actually makes sense.
320ae89
to
fa819d8
Compare
Codecov Report
@@ Coverage Diff @@
## master #89 +/- ##
==========================================
+ Coverage 50.33% 51.32% +0.99%
==========================================
Files 9 9
Lines 602 602
==========================================
+ Hits 303 309 +6
+ Misses 299 293 -6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
5163a44
to
a8f2223
Compare
a8f2223
to
2abbeef
Compare
if keychain_tracker.txout_index.is_relevant(&tx) { | ||
update.insert_tx(tx.clone(), Some(height))?; | ||
} | ||
keychain_tracker.txout_index.scan(&tx); |
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.
I think this is unsound -- you have to scan the txs first before deciding if it's relevant. scan the block when it comes in and each tx individually when the mempool comes in. From the docs of is_relevant
:
/// Whether any of the inputs of this transaction spend a txout tracked or whether any output
/// matches one of our script pubkeys.
///
/// It is easily possible to misuse this method and get false negatives by calling it before you
/// have scanned the `TxOut`s the transaction is spending. For example if you want to filter out
/// all the transactions in a block that are irrelevant you **must first scan all the
/// transactions in the block** and only then use this method.
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.
But we are scanning transactions in order so the previous outputs will be scanned before the current transaction right?
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.
Oh that's a good point but that only applies to the block txs. In the mempool are you guaranteed some kind of logical traversal order when you get the response. Maybe? But we shouldn't depend on it.
@LLFourn I'm not a fan of having changesets for last_used_indicies |
9d1c22c
to
2674ed5
Compare
Use the `local_cps` input to record checkpoint state during `Client::emit_blocks`
5b96359
to
4411e11
Compare
* `store_all_up_to` was using `Iter::any` which is short-circuiting * `derive_until_unused_gap` was wrong
RPC Chain example.