fix: Even more refactoring to code and documentation

Thank you to @LLFourn and @danielabrozzoni for these suggestions.
This commit is contained in:
志宇
2023-08-01 18:27:24 +08:00
parent bea8e5aff4
commit b206a985cf
6 changed files with 44 additions and 45 deletions

View File

@@ -627,7 +627,7 @@ impl<A: Anchor> TxGraph<A> {
};
let mut has_missing_height = false;
for anchor_block in tx_anchors.iter().map(Anchor::anchor_block) {
match chain.heights().get(&anchor_block.height) {
match chain.blocks().get(&anchor_block.height) {
None => {
has_missing_height = true;
continue;
@@ -651,7 +651,7 @@ impl<A: Anchor> TxGraph<A> {
.filter_map(move |(a, _)| {
let anchor_block = a.anchor_block();
if Some(anchor_block.height) != last_height_emitted
&& !chain.heights().contains_key(&anchor_block.height)
&& !chain.blocks().contains_key(&anchor_block.height)
{
last_height_emitted = Some(anchor_block.height);
Some(anchor_block.height)