mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-02-07 06:44:11 +00:00
public address from script_sig
This commit is contained in:
parent
323182c4a5
commit
5f274e70d0
@ -63,6 +63,17 @@ impl Script {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn public_key(&self) -> Option<[u8; 33]> {
|
||||
// TODO: How to more reliably parse this? The len could be anything, really.
|
||||
if self.0.len() == 107 || self.0.len() == 106 {
|
||||
let mut pk = [0u8; 33];
|
||||
pk.copy_from_slice(&self.0[self.0.len() - 33..self.0.len()]);
|
||||
Some(pk)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Shl<OpCode> for Script {
|
||||
|
Loading…
Reference in New Issue
Block a user