Optimize speed by skipping 4-byte fingerprint generation
This commit is contained in:
parent
c4d017e7c4
commit
46707eab19
|
@ -626,10 +626,13 @@ impl Xpriv {
|
|||
let tweaked =
|
||||
sk.add_tweak(&self.private_key.into()).expect("statistically impossible to hit");
|
||||
|
||||
// BREAKING CHANGE
|
||||
// parent_fingerprint: self.fingerprint(secp),
|
||||
// this brings a strong performance improvement
|
||||
Ok(Xpriv {
|
||||
network: self.network,
|
||||
depth: self.depth + 1,
|
||||
parent_fingerprint: self.fingerprint(secp),
|
||||
parent_fingerprint: Default::default(),
|
||||
child_number: i,
|
||||
private_key: tweaked,
|
||||
chain_code: ChainCode::from_hmac(hmac_result),
|
||||
|
@ -758,10 +761,13 @@ impl Xpub {
|
|||
let (sk, chain_code) = self.ckd_pub_tweak(i)?;
|
||||
let tweaked = self.public_key.add_exp_tweak(secp, &sk.into())?;
|
||||
|
||||
// BREAKING CHANGE
|
||||
// parent_fingerprint: self.fingerprint(),
|
||||
// this brings less of a performance improvement
|
||||
Ok(Xpub {
|
||||
network: self.network,
|
||||
depth: self.depth + 1,
|
||||
parent_fingerprint: self.fingerprint(),
|
||||
parent_fingerprint: Default::default(),
|
||||
child_number: i,
|
||||
public_key: tweaked,
|
||||
chain_code,
|
||||
|
|
Loading…
Reference in New Issue