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
feat: client side dag #1259
feat: client side dag #1259
Conversation
Ok(s) => s, | ||
Err(Error::MissingSpendRecord(_)) => { | ||
trace!("UTXO at {spend_addr:?}"); | ||
return Ok(dag); |
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.
1, Why it's not an error
to be returned if spend not found ?
2, The comment of the function doesn't explain this situation
if it's a value return, maybe put an explaination in the function comment ?
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.
If a Spend is not found, it means the CashNote was not spent yet. This is not an error in our DAG building, it simply indicates there is no need to fetch further as unspent money has no descendants.
|
||
/// Extends an existing SpendDag starting from the utxos in this DAG | ||
/// Covers the entirety of currently existing Spends if the DAG was built from Genesis | ||
pub async fn spend_dag_continue_from_utxos(&self, dag: &mut SpendDag) -> WalletResult<()> { |
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.
hmm... what's the different between this to be above spend_dag_extend
function ?
continue_from_utxos
is also an extend
?
maybe the spend_dag_extend
shall be renamed to dag_from_spend_address
?
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.
Yeah I agree, basically spend_dag_continue_from_utxos
extends the DAG in all directions from the current UTXOs at the extremities. That's total collection, the point of this is to collect all Spends that exist on the Network.
spend_dag_extend
is partial extension from one spend back to either Genesis or a known Spend that we already have in our DAG. It is adding one Spend and all its ancestors to our current DAG.
So both are extension, but one is only in one direction up to a specific Spend and the other one is in all directions.
dag_from_spend_address
makes me think that we build a dag from an address, maybe we need to add an extend somewhere.
How is spend_dag_extend_until
?
326d757
to
3d194ff
Compare
Description
reviewpad:summary