fix from/into electum bug (#5686)
This commit is contained in:
parent
18c3e90dbf
commit
7499efecf6
@ -54,7 +54,7 @@ impl Signature {
|
|||||||
/// Parse bytes as a signature encoded as RSV (V in "Electrum" notation).
|
/// Parse bytes as a signature encoded as RSV (V in "Electrum" notation).
|
||||||
/// May return empty (invalid) signature if given data has invalid length.
|
/// May return empty (invalid) signature if given data has invalid length.
|
||||||
pub fn from_electrum(data: &[u8]) -> Self {
|
pub fn from_electrum(data: &[u8]) -> Self {
|
||||||
if data.len() != 65 || data[0] < 27 {
|
if data.len() != 65 || data[64] < 27 {
|
||||||
// fallback to empty (invalid) signature
|
// fallback to empty (invalid) signature
|
||||||
return Signature::default();
|
return Signature::default();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user