Skip to main content

read_scriptnum

Function read_scriptnum 

Source
pub fn read_scriptnum(
    v: &[u8],
    require_minimal: bool,
    max_len: usize,
) -> Result<i64, ScriptIntError>
Expand description

Decodes a script number with caller-selected minimal-encoding and length rules.

ยงErrors

Returns ScriptIntError::NumericOverflow when v is longer than max_len, and ScriptIntError::NonMinimal when require_minimal is true and the encoding is non-minimal.