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