mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-18 08:45:00 +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 output;
|
||||||
let outpoint;
|
let outpoint;
|
||||||
{
|
{
|
||||||
let mut buf_r = BufReader::new(r);
|
let mut buf_r = BufReader::with_capacity(0, r);
|
||||||
output =
|
output =
|
||||||
TxOut::consensus_decode(&mut buf_r).map_err(|_| io::Error::other("invalid TxOut"))?;
|
TxOut::consensus_decode(&mut buf_r).map_err(|_| io::Error::other("invalid TxOut"))?;
|
||||||
outpoint =
|
outpoint =
|
||||||
|
|
|
@ -242,7 +242,7 @@ impl EventualityTrait for Eventuality {
|
||||||
buf
|
buf
|
||||||
}
|
}
|
||||||
fn read_completion<R: io::Read>(reader: &mut R) -> io::Result<Transaction> {
|
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}")))
|
.map_err(|e| io::Error::other(format!("{e}")))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue