bcoin-org / bcoin

Javascript bitcoin library for node.js and browsers
https://bcoin.io
Other
3.01k stars 811 forks source link

Added check for options type while creating network #1136

Open yatharthagoenka opened 1 year ago

yatharthagoenka commented 1 year ago

Fixes #1126 The solution proposed check whether 'options' is an object instance, and if so whether it has an attribute 'type' of type string using the assert function. In case this doesn't check out, the function would simply return a message invalidating the object, and avoid the issue altogether. If 'options' isn't an object, the function is carried out as done already.