Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function builder(options) {
/* jshint maxstatements: 20 */
/* jshint maxcomplexity: 10 */
if (!options) {
options = {};
}
if (!options.network) {
options.network = bitcore.Networks.defaultNetwork;
}
options.Block = options.Block || bitcore.Block;
options.BlockHeader = options.BlockHeader || bitcore.BlockHeader;
options.Transaction = options.Transaction || bitcore.Transaction;
options.MerkleBlock = options.MerkleBlock || bitcore.MerkleBlock;
options.protocolVersion = options.protocolVersion || 70001;
var exported = {
constructors: {
Block: options.Block,
BlockHeader: options.BlockHeader,
Transaction: options.Transaction,
MerkleBlock: options.MerkleBlock
},
defaults: {
protocolVersion: options.protocolVersion,
network: options.network
},
inventoryCommands: [