File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
modules/abstract-utxo/src/descriptor/createWallet Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -19,18 +19,20 @@ function createExternalInternalPair(
1919 if ( userKey . isNeutered ( ) ) {
2020 throw new Error ( 'User key must be private' ) ;
2121 }
22- return [
23- createNamedDescriptorWithSignature (
24- builder . name + '/external' ,
25- getDescriptorFromBuilder ( { ...builder , path : '0/*' } ) ,
26- userKey
27- ) ,
28- createNamedDescriptorWithSignature (
29- builder . name + '/internal' ,
30- getDescriptorFromBuilder ( { ...builder , path : '1/*' } ) ,
31- userKey
32- ) ,
33- ] ;
22+ const external = createNamedDescriptorWithSignature (
23+ builder . name + '/external' ,
24+ getDescriptorFromBuilder ( { ...builder , path : '0/*' } ) ,
25+ userKey
26+ ) ;
27+ const internal = createNamedDescriptorWithSignature (
28+ builder . name + '/internal' ,
29+ getDescriptorFromBuilder ( { ...builder , path : '1/*' } ) ,
30+ userKey
31+ ) ;
32+ if ( external . value === internal . value ) {
33+ throw new Error ( 'External and internal descriptors must be different. Make to use the path in descriptor.' ) ;
34+ }
35+ return [ external , internal ] ;
3436}
3537
3638/**
You can’t perform that action at this time.
0 commit comments