Open danielabrozzoni opened 1 year ago
Rebased on top of #157
(Still doesn't work though)
Rebased on top of #157
(Still doesn't work though)
Did you also add on the fix mentioned in Discord?
https://github.com/danielabrozzoni/bdk_core_staging/pull/2
I did a PR into yours fixing the balance disappearing after restart.
Looking good so far. In my opinion, the next steps for this PR:
Don't hold a mutable reference of the tracker when syncing. We need a structure (imo, like an iterator), where we only grab initial data from the tracker to create. Then it spits out data which the tracker can consume.
In my head, this thing that the CBF Iterator spits out can look something like this:
pub enum CbfData {
RelevantBlock(bitcoin::Block),
DisconnectedBlock(u32), // block height
}
Additionally, we need to somehow figure out how to properly do stop gap. We need logic that goes "uhh oh, we need more scripts for a rescan"!
Don't hold a mutable reference of the tracker when syncing. We need a structure (imo, like an iterator), where we only grab initial data from the tracker to create. Then it spits out data which the tracker can consume.
Right, done! :)
Additionally, we need to somehow figure out how to properly do stop gap. We need logic that goes "uhh oh, we need more scripts for a rescan"!
I think this is pretty trivial to implement, but I'd prefer to do it after receiving some feedback on the current code, if possible
@LLFourn I've tried removing the global CLI args but I couldn't find a way to do it. The "general commands" need to take in a client, and so the client needs to be initiated before our chain-specific commands.
@evanlinjin I see so you actually need to know "domains" for broadcasting too. So let's add the ability to add params to Send
(rather than globally). Then pass those params through to the closure I made in #198 for broadcasting. Then you can create the client inside the closure.
I just had a brief look through, nothing seems apparent to me why balance would disappear after restart. Will properly debug later.