-
Notifications
You must be signed in to change notification settings - Fork 9
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
One chain source to rule them all #564
Conversation
c329c16
to
0b838eb
Compare
lib/core/src/restore.rs
Outdated
} | ||
|
||
impl LiquidSdk { | ||
pub(crate) async fn get_monitored_swaps_list(&self, height: u32) -> Result<SwapsList> { | ||
let send_swaps = self.persister.list_pending_send_swaps()?; | ||
let receive_swaps = self.persister.list_ongoing_receive_swaps()?; |
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.
Do we list here also received swaps that were expired?
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.
No, but the expiry will be the same as the invoice expiry, so the invoice shouldn't be valid. At this point also the MRH address can be reused from the address pool, so shouldn't be associated to the swap
807bc5b
to
ef748f0
Compare
a073084
to
fad9a69
Compare
lib/core/src/sdk.rs
Outdated
let mrh_tx_id = receive_data.mrh_tx_id.clone().map(|h| h.txid.to_string()); | ||
_ = self | ||
.receive_swap_handler | ||
.update_swap_info( |
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.
Will this send trigger a payment event? Previously the event was triggered only on change.
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 they are repeated anyway in some cases. I seem to remember seeing multiple PaymentPending or PaymentWaitingConfirmation events. Probably because its valid to update Pending to Pending even if the details are the same.
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 mean also on the update_swap_info occurences bellow we don't seem to be checking if it is a really state transition so it looks like on every sync we will get payment events.
Previousely the code was checking for every associated claim if it really transitioned to from mempool to confirmed (completed) or just intruduced as undonfirmed (pending) before emitting events.
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.
Looks good!
ad3f936
to
07bb41e
Compare
c77576f
to
9279ab9
Compare
a89090e
to
54609d3
Compare
083c85b
to
0c96bd5
Compare
54609d3
to
9279ab9
Compare
9279ab9
to
044f956
Compare
044f956
to
8e04fe1
Compare
This PR:
TODO (in a followup PR):