node: witness option. announce services properly.
This commit is contained in:
parent
cd4bcb48e8
commit
cdbe6fc940
@ -701,7 +701,7 @@ Chain.prototype.getDeployments = function getDeployments(block, prev, ancestors,
|
|||||||
if (err)
|
if (err)
|
||||||
return next(err);
|
return next(err);
|
||||||
|
|
||||||
if (active && self.network.witness) {
|
if (active && self.options.witness) {
|
||||||
state.flags |= constants.flags.VERIFY_WITNESS;
|
state.flags |= constants.flags.VERIFY_WITNESS;
|
||||||
if (!self.state.hasWitness())
|
if (!self.state.hasWitness())
|
||||||
self.logger.warning('Segwit has been activated.');
|
self.logger.warning('Segwit has been activated.');
|
||||||
|
|||||||
@ -61,6 +61,7 @@ function Fullnode(options) {
|
|||||||
location: this.location('chain'),
|
location: this.location('chain'),
|
||||||
preload: false,
|
preload: false,
|
||||||
spv: false,
|
spv: false,
|
||||||
|
witness: this.network.witness,
|
||||||
prune: this.options.prune,
|
prune: this.options.prune,
|
||||||
useCheckpoints: this.options.useCheckpoints,
|
useCheckpoints: this.options.useCheckpoints,
|
||||||
coinCache: this.options.coinCache
|
coinCache: this.options.coinCache
|
||||||
@ -121,6 +122,7 @@ function Fullnode(options) {
|
|||||||
fees: this.fees,
|
fees: this.fees,
|
||||||
db: this.db,
|
db: this.db,
|
||||||
location: this.location('walletdb'),
|
location: this.location('walletdb'),
|
||||||
|
witness: this.network.witness,
|
||||||
useCheckpoints: this.options.useCheckpoints,
|
useCheckpoints: this.options.useCheckpoints,
|
||||||
verify: false
|
verify: false
|
||||||
});
|
});
|
||||||
|
|||||||
@ -479,7 +479,7 @@ Peer.prototype.sendHeaders = function sendHeaders(items) {
|
|||||||
Peer.prototype.sendVersion = function sendVersion() {
|
Peer.prototype.sendVersion = function sendVersion() {
|
||||||
var packet = new VersionPacket({
|
var packet = new VersionPacket({
|
||||||
version: constants.VERSION,
|
version: constants.VERSION,
|
||||||
services: constants.LOCAL_SERVICES,
|
services: this.pool.services,
|
||||||
ts: bcoin.now(),
|
ts: bcoin.now(),
|
||||||
recv: new NetworkAddress(),
|
recv: new NetworkAddress(),
|
||||||
from: this.pool.address,
|
from: this.pool.address,
|
||||||
|
|||||||
@ -122,9 +122,14 @@ function Pool(options) {
|
|||||||
this.seeds.push(seed);
|
this.seeds.push(seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.services = constants.LOCAL_SERVICES;
|
||||||
|
|
||||||
|
if (!this.options.witness)
|
||||||
|
this.services &= ~constants.services.WITNESS;
|
||||||
|
|
||||||
this.address = new NetworkAddress({
|
this.address = new NetworkAddress({
|
||||||
ts: utils.now() - (process.uptime() | 0),
|
ts: utils.now() - (process.uptime() | 0),
|
||||||
services: constants.LOCAL_SERVICES,
|
services: this.services,
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
port: this.network.port
|
port: this.network.port
|
||||||
});
|
});
|
||||||
|
|||||||
@ -46,6 +46,7 @@ function SPVNode(options) {
|
|||||||
profiler: this.profiler,
|
profiler: this.profiler,
|
||||||
db: this.db,
|
db: this.db,
|
||||||
location: this.location('spvchain'),
|
location: this.location('spvchain'),
|
||||||
|
witness: this.network.witness,
|
||||||
preload: this.options.preload,
|
preload: this.options.preload,
|
||||||
useCheckpoints: this.options.useCheckpoints,
|
useCheckpoints: this.options.useCheckpoints,
|
||||||
spv: true
|
spv: true
|
||||||
@ -68,6 +69,7 @@ function SPVNode(options) {
|
|||||||
logger: this.logger,
|
logger: this.logger,
|
||||||
db: this.db,
|
db: this.db,
|
||||||
location: this.location('walletdb'),
|
location: this.location('walletdb'),
|
||||||
|
witness: this.network.witness,
|
||||||
verify: true
|
verify: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1769,7 +1769,7 @@ function Account(db, options) {
|
|||||||
|
|
||||||
this.id = null;
|
this.id = null;
|
||||||
this.name = null;
|
this.name = null;
|
||||||
this.witness = this.network.witness;
|
this.witness = this.db.options.witness;
|
||||||
this.accountKey = null;
|
this.accountKey = null;
|
||||||
this.accountIndex = 0;
|
this.accountIndex = 0;
|
||||||
this.receiveDepth = 0;
|
this.receiveDepth = 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user