"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DogecoinP2PWorker = void 0;
const block_1 = require("../../models/block");
const p2p_1 = require("../litecoin/p2p");
class DogecoinP2PWorker extends p2p_1.LitecoinP2PWorker {
    constructor({ chain, network, chainConfig, blockModel = block_1.BitcoinBlockStorage }) {
        super({ chain, network, chainConfig, blockModel });
        if (this.network === 'regtest') {
            this.bitcoreLib.Networks.enableRegtest();
        }
        this.messages = new this.bitcoreP2p.Messages({
            protocolVersion: 70003,
            network: this.bitcoreLib.Networks.get(this.network),
            Block: this.bitcoreLib.Block,
            Transaction: this.bitcoreLib.Transaction,
            BlockHeader: this.bitcoreLib.BlockHeader
        });
        this.pool = new this.bitcoreP2p.Pool({
            addrs: this.chainConfig.trustedPeers.map(peer => {
                return {
                    ip: {
                        v4: peer.host
                    },
                    port: peer.port
                };
            }),
            dnsSeed: false,
            listenAddr: false,
            network: this.network,
            messages: this.messages
        });
    }
}
exports.DogecoinP2PWorker = DogecoinP2PWorker;
//# sourceMappingURL=p2p.js.map