diff --git a/bitcoin/src/blockdata/script/mod.rs b/bitcoin/src/blockdata/script/mod.rs index c4e027fa..5e00b1a5 100644 --- a/bitcoin/src/blockdata/script/mod.rs +++ b/bitcoin/src/blockdata/script/mod.rs @@ -66,6 +66,11 @@ pub use self::types::*; /// Encodes an integer in script(minimal CScriptNum) format. /// /// Writes bytes into the buffer and returns the number of bytes written. +/// +/// Note that `write_scriptint`/`read_scriptint` do not roundtrip if the value written requires +/// more than 4 bytes, this is in line with Bitcoin Core (see [`CScriptNum::serialize`]). +/// +/// [`CScriptNum::serialize`]: pub fn write_scriptint(out: &mut [u8; 8], n: i64) -> usize { let mut len = 0; if n == 0 { return len; }