* Avoid sequential borrows in `LatestChainTip` Calling `watch::Receiver::borrow` more than once in the same scope can cause a deadlock. The instrumented methods were calling `borrow` twice to record instrumented fields. This refactors things to ensure `borrow` is only called once to record the fields and perform any actions with the chain tip block. * Remove `borrow()` calls in `ChainTipChange` Refactor to use a `LatestChainTip` instance instead, which safely protects the internal `watch::Receiver` so that it is not borrowed more than once in the same scope. * Add a paragraph to the Asynchronous guide Warn against using two borrow guards in the same scope, and describe why that can lead to a deadlock. |
||
|---|---|---|
| .. | ||
| src | ||
| theme | ||
| .gitignore | ||
| book.toml | ||
| firebase.json | ||