-
Notifications
You must be signed in to change notification settings - Fork 12
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #79 +/- ##
=======================================
Coverage 56.74% 56.74%
=======================================
Files 10 10
Lines 252 252
=======================================
Hits 143 143
Misses 109 109 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
8a79189
to
abd7cde
Compare
@evanlinjin, updated the example to work with the latest invariant around |
abd7cde
to
420f01d
Compare
Latest push
@evanlinjin @LLFourn This is now ready for a look.. |
420f01d
to
039a72d
Compare
unreachable!("We should not encounter this error as we ensured tx_height <= tip.height"); | ||
} | ||
sparse_chain::InsertTxError::TxMovedUnexpectedly { .. } => { | ||
/* This means there is a reorg, we will handle this situation below */ |
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.
It seems the situation is not handled. Maybe it is better to break here?
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 the break happens in the next segment // Check for Reorg during the above sync process
. I do think we should do better than just error in such cases. But this is how it's done for other examples, so I followed the same here too.
A few lines above, when we first check for Reorg during sync
, we call the scan function recursively. Maybe we can do the same for the case after extracting the list of transactions? i.e, if there's again a reorg during sync, call scan again?
Open to suggestions here.
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.
Reorg during sync is a very low probability situation, and when the user gets this error, they should just run the scan again. In that perspective, it makes sense to call the scan again internally rather than throwing the error?
ede44ba
to
4c5e94f
Compare
Similar to electrum, RPC sync is done in two steps. - get all the newly added txid from and initial wallet sync. This stage also includes the reorg detection. - Fetch the txs not already stpred in the TxGraph and complete the final update structure. - Apply the update to both tracker and database. Note: The current approach of RPC syncing with a corresponding internal core wallet, cannot do random script pubkey scanning.
4c5e94f
to
ff0145e
Compare
closing in favour of #170 |
This PR adds a RPC syncing example with "create a core wallet, and call
listtransaction
" approach.Similar to electrum, RPC sync is done in two steps.
get all the newly added txid from and initial wallet sync. This stage also includes the reorg detection.
Fetch the txs not already stpred in the TxGraph and complete the final update structure.
Apply the update to both tracker and database.
Note: The current approach of RPC syncing with a corresponding internal
core wallet, cannot do random script pubkey scanning.