Use write_all to write whole buffer
A better way to write a byte string is to use write all so that `ErrorKind::Interupted` is not returned. Use `write_all` to write the non-sense (error indication) string to the writer when we hit the SIGHASH_SINGLE bug.
This commit is contained in:
parent
51c60b8507
commit
a6efe982bd
|
@ -353,7 +353,7 @@ impl Transaction {
|
|||
// will result in the data written to the writer being hashed, however the correct
|
||||
// handling of the SIGHASH_SINGLE bug is to return the 'one array' - either implement
|
||||
// this behaviour manually or use `signature_hash()`.
|
||||
let _ = writer.write(b"[not a transaction] SIGHASH_SINGLE bug")?;
|
||||
writer.write_all(b"[not a transaction] SIGHASH_SINGLE bug")?;
|
||||
return Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue