Skip to content

Commit d33f774

Browse files
committed
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.
1 parent 6880772 commit d33f774

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/blockdata/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ impl Transaction {
353353
// will result in the data written to the writer being hashed, however the correct
354354
// handling of the SIGHASH_SINGLE bug is to return the 'one array' - either implement
355355
// this behaviour manually or use `signature_hash()`.
356-
let _ = writer.write(b"[not a transaction] SIGHASH_SINGLE bug")?;
356+
writer.write_all(b"[not a transaction] SIGHASH_SINGLE bug")?;
357357
return Ok(())
358358
}
359359

0 commit comments

Comments
 (0)