You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
Once a CFD is was closed we should stop monitoring for any transactions related to this CFD.
We should be able to achieve this quite easily by:
Add some functionality to btsieve to "un-monitor", i.e. remove scripts by txid from the awaiting_status state.
Upon closing the CFD we send a message to the monitor to stop monitoring.
⬅️ original description. The original description of this ticket read a bit different, but I think it is simpler to just remove all monitoring upon closing a CFD.
At the moment we don't remove "competing" transactions from monitoring when we reach a final state.
This means, when a final transaction (e.g. a CET) reaches finality we will still monitor for other transactions (e.g. refund_tx) that can actually not happen anymore.
For `CETs` and `refund_tx` this is most relevant, because they have the same script. Since we only fetch by script from Electrum we will always receive both (and then match them by `Txid`+`Script`).
When reaching finality of a final tx (CET, refund_tx, collaborate_close_tx) we have to remove the remaining "competing" transactions.
Note, that removing the competing transactions is not critical, but when fetching GetHistoryRes by script we can have entries that we don't care about anymore. We might see other weird side effect which should be limited to logs (because we have guards in place to not allow state transitions when in a final state).
and the related section here, where the None path represents the case where we don't care about a transaction-id anymore but still fetched transactions that have that particular script:
Once a CFD is was closed we should stop monitoring for any transactions related to this CFD.
We should be able to achieve this quite easily by:
btsieve
to "un-monitor", i.e. removescripts
bytxid
from theawaiting_status
state.⬅️ original description. The original description of this ticket read a bit different, but I think it is simpler to just remove all monitoring upon closing a CFD.
At the moment we don't remove "competing" transactions from monitoring when we reach a final state. This means, when a final transaction (e.g. a CET) reaches finality we will still monitor for other transactions (e.g. refund_tx) that can actually not happen anymore. For `CETs` and `refund_tx` this is most relevant, because they have the same script. Since we only fetch by script from Electrum we will always receive both (and then match them by `Txid`+`Script`).When reaching finality of a final tx (CET, refund_tx, collaborate_close_tx) we have to remove the remaining "competing" transactions.
Note, that removing the competing transactions is not critical, but when fetching
GetHistoryRes
by script we can have entries that we don't care about anymore. We might see other weird side effect which should be limited to logs (because we have guards in place to not allow state transitions when in a final state).See this Todo in
monitor.rs
:https://github.com/comit-network/hermes/blob/8d0390156598dc0d38eee5d34e47daf8bc74f616/daemon/src/monitor.rs#L386-L390
and the related section here, where the
None
path represents the case where we don't care about a transaction-id anymore but still fetched transactions that have that particular script:https://github.com/comit-network/hermes/blob/8d0390156598dc0d38eee5d34e47daf8bc74f616/daemon/src/monitor.rs#L281-L297
The text was updated successfully, but these errors were encountered: