Make bdk and bdk_chain work under 1.57.0

- rewrite some parts of the code to deal with older borrow checker
- downgraded hashbrown
This commit is contained in:
Steve Myers
2023-03-02 22:05:11 -06:00
committed by Daniela Brozzoni
parent 3a5d727899
commit 38ef170ed1
16 changed files with 85 additions and 195 deletions

View File

@@ -419,7 +419,7 @@ impl<T> TxGraph<T> {
tx.input
.iter()
.enumerate()
.filter_map(|(vin, txin)| self.spends.get(&txin.previous_output).zip(Some(vin)))
.filter_map(move |(vin, txin)| self.spends.get(&txin.previous_output).zip(Some(vin)))
.flat_map(|(spends, vin)| core::iter::repeat(vin).zip(spends.iter().cloned()))
.filter(move |(_, conflicting_txid)| *conflicting_txid != txid)
}
@@ -474,7 +474,7 @@ impl<T> Additions<T> {
.output
.iter()
.enumerate()
.map(|(vout, txout)| (OutPoint::new(tx.as_tx().txid(), vout as _), txout))
.map(move |(vout, txout)| (OutPoint::new(tx.as_tx().txid(), vout as _), txout))
})
.chain(self.txout.iter().map(|(op, txout)| (*op, txout)))
}