mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-23 08:32:23 +03:00
kns_indexer: optimistically handle notes
This commit is contained in:
parent
09d537e9b0
commit
be6b932165
@ -433,15 +433,22 @@ fn handle_log(
|
|||||||
if !kimap::valid_note(¬e) {
|
if !kimap::valid_note(¬e) {
|
||||||
return Err(anyhow::anyhow!("skipping invalid note: {note}"));
|
return Err(anyhow::anyhow!("skipping invalid note: {note}"));
|
||||||
}
|
}
|
||||||
if let Some(block_number) = log.block_number {
|
// handle note: if it precedes parent mint event, add it to pending_notes
|
||||||
print_to_terminal(
|
if let Err(e) = handle_note(state, &decoded) {
|
||||||
1,
|
if let Some(KnsError::NoParentError) = e.downcast_ref::<KnsError>() {
|
||||||
&format!("adding note to pending_notes for block {block_number}"),
|
if let Some(KnsError::NoParentError) = e.downcast_ref::<KnsError>() {
|
||||||
);
|
if let Some(block_number) = log.block_number {
|
||||||
pending_notes
|
print_to_terminal(
|
||||||
.entry(block_number)
|
1,
|
||||||
.or_default()
|
&format!("adding note to pending_notes for block {block_number}"),
|
||||||
.push((decoded, 0));
|
);
|
||||||
|
pending_notes
|
||||||
|
.entry(block_number)
|
||||||
|
.or_default()
|
||||||
|
.push((decoded, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_log => {
|
_log => {
|
||||||
|
Loading…
Reference in New Issue
Block a user