segwit activation for testnet. work around leveldown bug.

This commit is contained in:
Christopher Jeffrey 2016-05-21 16:39:16 -07:00
parent f7dd8a6e8a
commit 2c809e28fd
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
4 changed files with 34 additions and 8 deletions

View File

@ -239,7 +239,7 @@ LowlevelUp.prototype.iterate = function iterate(options, callback) {
var items = [];
var iter;
iter = this.iterator({
options = {
gte: options.gte,
lte: options.lte,
keys: true,
@ -248,7 +248,24 @@ LowlevelUp.prototype.iterate = function iterate(options, callback) {
keyAsBuffer: false,
limit: options.limit,
reverse: options.reverse
});
};
if (options.gte == null)
delete options.gte;
if (options.lte == null)
delete options.lte;
if (options.values == null)
delete options.values;
if (options.limit == null)
delete options.limit;
if (options.reverse == null)
delete options.reverse;
iter = this.iterator(options);
(function next() {
iter.next(function(err, key, value) {

View File

@ -184,7 +184,7 @@ Peer.prototype._init = function init() {
});
this.parser.on('error', function(err) {
self.sendReject(null, 'malformed', 'error parsing message', 1);
self.sendReject(null, 'malformed', 'error parsing message', 10);
self._error(err);
});
@ -1528,7 +1528,7 @@ Peer.prototype.sendReject = function sendReject(obj, code, reason, score) {
Peer.prototype.inspect = function inspect() {
return '<Peer:'
+ ' id=' + this.id
+ ' connected=' + this.connected
+ ' ack=' + this.ack
+ ' host=' + this.hostname
+ ' ping=' + this.minPing
+ '>';

View File

@ -1101,7 +1101,8 @@ Pool.prototype._addLeech = function _addLeech(socket) {
priority: false,
network: false,
spv: false,
witness: false
witness: false,
ts: utils.now()
});
bcoin.debug('Added leech peer (%s).', peer.hostname);

View File

@ -332,7 +332,7 @@ main.deployments = {
timeout: 2100000000
}
// bip109: {
// bit: 4,
// bit: 28,
// startTime: 1453939200, // Jan 28th, 2016
// timeout: 1514764800 // Jan 1st, 2018
// }
@ -537,7 +537,9 @@ testnet.witness = false;
testnet.segwitHeight = 2000000000;
testnet.ruleChangeActivationThreshold = 1512; // 75% for testchains
testnet.minerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
testnet.deployments = {
testdummy: {
bit: 28,
@ -551,8 +553,8 @@ testnet.deployments = {
},
witness: {
bit: 1,
startTime: 2000000000, // Far in the future
timeout: 2100000000
startTime: 1462060800, // May 1st 2016
timeout: 1493596800 // May 1st 2017
}
};
@ -676,7 +678,9 @@ regtest.witness = false;
regtest.segwitHeight = -1;
regtest.ruleChangeActivationThreshold = 108; // 75% for testchains
regtest.minerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
regtest.deployments = {
testdummy: {
bit: 28,
@ -815,7 +819,9 @@ segnet3.witness = true;
segnet3.segwitHeight = 0;
segnet3.ruleChangeActivationThreshold = 108;
segnet3.minerConfirmationWindow = 144;
segnet3.deployments = {};
segnet3.prefixes = {
@ -936,7 +942,9 @@ segnet4.witness = true;
segnet4.segwitHeight = -1;
segnet4.ruleChangeActivationThreshold = 108;
segnet4.minerConfirmationWindow = 144;
segnet4.deployments = {
testdummy: {
bit: 28,