File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -56,16 +56,19 @@ export async function nodeOpts(opts: MainOptions): Promise<FabricOptions> {
56
56
57
57
export async function anchorFromOpts ( opts : MainOptions ) : Promise < AnchorStore > {
58
58
const localAnchors = opts . localAnchors || process . env . FABRIC_LOCAL_ANCHORS ;
59
- const remoteAnchors =
60
- opts . remoteAnchors ||
61
- ( process . env . FABRIC_REMOTE_ANCHORS
62
- ? process . env . FABRIC_REMOTE_ANCHORS . split ( ',' )
63
- : [ 'http://127.0.0.1:7225/root-anchors.json' ] ) ;
59
+ const remoteAnchors = opts . remoteAnchors || ( process . env . FABRIC_REMOTE_ANCHORS ? process . env . FABRIC_REMOTE_ANCHORS . split ( ',' ) : undefined ) ;
64
60
65
- return AnchorStore . create ( {
66
- localPath : localAnchors ,
67
- remoteUrls : remoteAnchors ,
68
- } ) ;
61
+ const updateOptions : any = { } ;
62
+
63
+ if ( localAnchors ) {
64
+ updateOptions . localPath = localAnchors ;
65
+ } else if ( remoteAnchors ) {
66
+ updateOptions . remoteUrls = remoteAnchors ;
67
+ } else {
68
+ updateOptions . remoteUrls = [ 'http://127.0.0.1:7225/root-anchors.json' ] ;
69
+ }
70
+
71
+ return AnchorStore . create ( updateOptions ) ;
69
72
}
70
73
71
74
export function joinHostPort ( address : Address | null ) : string {
You can’t perform that action at this time.
0 commit comments