Set the BufReader capacity to 0

Fixes issues with bitcoin.

We only use a BufReader as it's the only way to use a std::io::Read generic as
a bitcoin::io::Read object.
This commit is contained in:
Luke Parker
2024-05-21 07:06:13 -04:00
parent f93214012d
commit 09aac20293
2 changed files with 2 additions and 2 deletions

View File

@@ -242,7 +242,7 @@ impl EventualityTrait for Eventuality {
buf
}
fn read_completion<R: io::Read>(reader: &mut R) -> io::Result<Transaction> {
Transaction::consensus_decode(&mut io::BufReader::new(reader))
Transaction::consensus_decode(&mut io::BufReader::with_capacity(0, reader))
.map_err(|e| io::Error::other(format!("{e}")))
}
}