mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-03 09:29:46 +00:00
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:
parent
f93214012d
commit
09aac20293
2 changed files with 2 additions and 2 deletions
|
@ -93,7 +93,7 @@ impl ReceivedOutput {
|
|||
let output;
|
||||
let outpoint;
|
||||
{
|
||||
let mut buf_r = BufReader::new(r);
|
||||
let mut buf_r = BufReader::with_capacity(0, r);
|
||||
output =
|
||||
TxOut::consensus_decode(&mut buf_r).map_err(|_| io::Error::other("invalid TxOut"))?;
|
||||
outpoint =
|
||||
|
|
|
@ -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}")))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue