File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ export class HDKey {
133
133
}
134
134
this . pubKey = hex . toRawBytes ( true ) ; // force compressed point
135
135
this . pubHash = hash160 ( this . pubKey ) ;
136
- this . privKey = undefined ;
136
+ this . wipePrivateData ( ) ;
137
137
}
138
138
139
139
get privateExtendedKey ( ) : string {
@@ -258,12 +258,11 @@ export class HDKey {
258
258
return secp . verify ( sig , hash , this . publicKey ) ;
259
259
}
260
260
public wipePrivateData ( ) : this {
261
- if ( this . privKey ) {
262
- this . privKey = undefined ;
261
+ this . privKey = undefined ;
262
+ if ( this . privKeyBytes != null ) {
263
263
this . privKeyBytes ! . fill ( 0 ) ;
264
264
this . privKeyBytes = undefined ;
265
265
}
266
- this . privKey = undefined ;
267
266
return this ;
268
267
}
269
268
public toJSON ( ) : { xpriv : string ; xpub : string } {
You can’t perform that action at this time.
0 commit comments