Browse Source

Avoid spamming the logs and add Todo

We keep seeing this in the logs, after a final tx went in:

```
2021-10-11 16:58:18 ERROR Could not find script in own state for txid b542cbc1920bdd926d79fb17377eda7152ed944ec64a1b09ce68dd11d9e7467e, ignoring
```

This happens because multiple transactions have the same script (e.g. CET, refund).
Once the CET is final we remove it from monitoring, which results in the txid not being available when matching.
refactor/no-log-handler
Daniel Karzel 3 years ago
committed by Lucas Soriano del Pino
parent
commit
8d03901565
No known key found for this signature in database GPG Key ID: EE611E973A1530E7
  1. 8
      daemon/src/monitor.rs

8
daemon/src/monitor.rs

@ -284,7 +284,7 @@ where
let txid = response.tx_hash;
let script = match txid_to_script.get(&txid) {
None => {
tracing::error!(
tracing::trace!(
"Could not find script in own state for txid {}, ignoring",
txid
);
@ -383,6 +383,12 @@ where
tracing::trace!("{} subscriptions reached their monitoring target, {} remaining for this script", reached_monitoring_target.len(), remaining.len());
// TODO: When reaching finality of a final tx (CET, refund_tx,
// collaborate_close_tx) we have to remove the remaining "competing"
// transactions. This is not critical, but when fetching
// `GetHistoryRes` by script we can have entries that we don't care about
// anymore.
if remaining.is_empty() {
occupied.remove();
} else {

Loading…
Cancel
Save