Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
Merge version 0.2.5.18 from dev
Browse files Browse the repository at this point in the history
Merge version 0.2.5.18 from dev
  • Loading branch information
Greg-Griffith authored Sep 7, 2019
2 parents 6635ad1 + 3efe538 commit eeec970
Show file tree
Hide file tree
Showing 60 changed files with 1,802 additions and 880 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 2)
define(_CLIENT_VERSION_REVISION, 5)
define(_CLIENT_VERSION_BUILD, 17) # version 99 here indicates an unreleased version
define(_CLIENT_VERSION_BUILD, 18) # version 99 here indicates an unreleased version
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2019)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-arm.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "eccoin-linux-0.2.5.17"
name: "eccoin-linux-0.2.5.18"
enable_cache: true
suites:
- "bionic"
Expand Down
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-linux.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "eccoin-linux-0.2.5.17"
name: "eccoin-linux-0.2.5.18"
enable_cache: true
suites:
- "bionic"
Expand Down
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-osx.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "eccoin-osx-0.2.5.17"
name: "eccoin-osx-0.2.5.18"
enable_cache: true
suites:
- "bionic"
Expand Down
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-win.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "eccoin-win-0.2.5.17"
name: "eccoin-win-0.2.5.18"
enable_cache: true
suites:
- "bionic"
Expand Down
2 changes: 1 addition & 1 deletion qa/pull-tester/rpc-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def option_passed(option_without_dashes):
'multi_rpc',
# 'fundrawtransaction', ???
'reindex',
'getchaintips',
Disabled('getchaintips', "issue with syncpoints getting stuck"),
'httpbasics',
'keypool',
'listtransactions',
Expand Down
117 changes: 117 additions & 0 deletions qa/rpc-tests/aodv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import test_framework.loginit
# This is a template to make creating new QA tests easy.
# You can also use this template to quickly start and connect a few regtest nodes.

import time
import sys
if sys.version_info[0] < 3:
raise "Use Python 3"
import logging

from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *

class AodvTest (BitcoinTestFramework):

def setup_chain(self,bitcoinConfDict=None, wallets=None):
print("Initializing test directory "+self.options.tmpdir)
# pick this one to start from the cached 4 node 100 blocks mined configuration
# initialize_chain(self.options.tmpdir)
# pick this one to start at 0 mined blocks
initialize_chain_clean(self.options.tmpdir, 6, bitcoinConfDict, wallets)
# Number of nodes to initialize ----------> ^

def setup_network(self, split=False):
self.nodes = start_nodes(6, self.options.tmpdir)
connect_nodes_bi(self.nodes,0,1)
connect_nodes_bi(self.nodes,1,2)
connect_nodes_bi(self.nodes,2,3)
connect_nodes_bi(self.nodes,3,4)
connect_nodes_bi(self.nodes,4,5)
self.is_network_split=False
self.sync_all()

def run_test (self):
self.sync_blocks()

for x in range(0, 1):
self.nodes[0].generate(1);
self.sync_blocks()

assert_not_equal(self.nodes[0].getconnectioncount(), 3)
print(self.nodes[0].getconnectioncount())
print(self.nodes[0].getaodvtable())
assert_not_equal(self.nodes[1].getconnectioncount(), 3)
print(self.nodes[1].getconnectioncount())
assert_not_equal(self.nodes[2].getconnectioncount(), 3)
print(self.nodes[2].getconnectioncount())
assert_not_equal(self.nodes[3].getconnectioncount(), 3)
print(self.nodes[3].getconnectioncount())

key0 = self.nodes[0].getroutingpubkey()
key1 = self.nodes[1].getroutingpubkey()
key2 = self.nodes[2].getroutingpubkey()
key3 = self.nodes[3].getroutingpubkey()
key4 = self.nodes[4].getroutingpubkey()
key5 = self.nodes[5].getroutingpubkey()

self.nodes[0].findroute(key0)
time.sleep(1)
assert_equal(self.nodes[0].haveroute(key0), True)
self.nodes[0].findroute(key1)
time.sleep(1)
assert_equal(self.nodes[0].haveroute(key1), True)
self.nodes[0].findroute(key2)
time.sleep(1)
assert_equal(self.nodes[0].haveroute(key2), True)
self.nodes[0].findroute(key3)
time.sleep(1)
assert_equal(self.nodes[0].haveroute(key3), True)
self.nodes[0].findroute(key4)
time.sleep(1)
assert_equal(self.nodes[0].haveroute(key4), True)
self.nodes[0].findroute(key5)
time.sleep(1)
assert_equal(self.nodes[0].haveroute(key5), True)


if __name__ == '__main__':
AodvTest().main(bitcoinConfDict={"beta": 1})

# Create a convenient function for an interactive python debugging session
def Test():
t = AodvTest()
bitcoinConf = {
"debug": ["net", "blk", "thin", "mempool", "req", "bench", "evict"],
"blockprioritysize": 2000000, # we don't want any transactions rejected due to insufficient fees...
"beta": 1
}


flags = []
# you may want these additional flags:
# flags.append("--nocleanup")
# flags.append("--noshutdown")

# Execution is much faster if a ramdisk is used, so use it if one exists in a typical location
if os.path.isdir("/ramdisk/test"):
flags.append("--tmppfx=/ramdisk/test")

# Out-of-source builds are awkward to start because they need an additional flag
# automatically add this flag during testing for common out-of-source locations
here = os.path.dirname(os.path.abspath(__file__))
if not os.path.exists(os.path.abspath(here + "/../../src/eccoind")):
dbg = os.path.abspath(here + "/../../debug/src/eccoind")
rel = os.path.abspath(here + "/../../release/src/eccoind")
if os.path.exists(dbg):
print("Running from the debug directory (%s)" % dbg)
flags.append("--srcdir=%s" % os.path.dirname(dbg))
elif os.path.exists(rel):
print("Running from the release directory (%s)" % rel)
flags.append("--srcdir=%s" % os.path.dirname(rel))

t.main(flags, bitcoinConf, None)
1 change: 1 addition & 0 deletions qa/rpc-tests/getchaintips.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def run_test (self):
# Split the network and build two chains of different lengths.
self.split_network ()
self.nodes[0].generate(10)
self.sync_all ()
self.nodes[2].generate(20)
self.sync_all ()

Expand Down
47 changes: 19 additions & 28 deletions qa/rpc-tests/verifydb.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,56 +51,50 @@ def run_test (self):
# get to 100 blocks
for i in range (68):
self.nodes[1].generate(1)
j = randint(1, 5)
for k in range(j):
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1)
if i % 10 == 0:
if i % 15 == 0:
j = randint(1, 5)
for k in range(j):
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1)
self.sync_all()
self.sync_all()

#get to 500 blocks
for i in range (100):
self.nodes[0].generate(1)
j = randint(1, 5)
for k in range(j):
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 1)
if i % 50 == 0:
if i % 15 == 0:
j = randint(1, 5)
for k in range(j):
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 1)
self.sync_all()
self.sync_all()

for i in range (100):
self.nodes[1].generate(1)
j = randint(1, 5)
for k in range(j):
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1)
if i % 50 == 0:
if i % 25 == 0:
self.sync_all()
self.sync_all()

for i in range (100):
self.nodes[0].generate(1)
j = randint(1, 5)
for k in range(j):
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 1)
if i % 50 == 0:
if i % 25 == 0:
self.sync_all()
self.sync_all()

for i in range (100):
self.nodes[1].generate(1)
j = randint(1, 5)
for k in range(j):
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1)
if i % 50 == 0:
if i % 25 == 0:
j = randint(1, 5)
for k in range(j):
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1)
self.sync_all()
self.sync_all()
#pos blocks
for i in range (100):
self.nodes[1].generatepos(1)
j = randint(1, 5)
for k in range(j):
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1)
if i % 10 == 0:
if i % 25 == 0:
j = randint(1, 5)
for k in range(j):
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1)
self.sync_all()
self.sync_all()

Expand All @@ -111,10 +105,7 @@ def run_test (self):
# start the nodes again with high db checks
self.node_args = [['-checklevel=4', '-checkblocks=0'], ['-checklevel=4', '-checkblocks=0']]
self.nodes = start_nodes(2, self.options.tmpdir, self.node_args)

#generate more blocks
self.nodes[0].generate(500)


#stop the nodes
stop_nodes(self.nodes)
wait_bitcoinds()
Expand Down
4 changes: 2 additions & 2 deletions src/.formatted-files
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ consensus/consensus.h
consensus/merkle.cpp
consensus/merkle.h
consensus/params.h
consensus/tx_verify.cpp
consensus/tx_verify.h
consensus/validation.h
core_io.h
core_memusage.h
Expand Down Expand Up @@ -112,8 +114,6 @@ processblock.cpp
processblock.h
processheader.cpp
processheader.h
processtx.cpp
processtx.h
pubkey.cpp
pubkey.h
random.cpp
Expand Down
9 changes: 7 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ BITCOIN_CORE_H = \
args.h \
arith_uint256.h \
base58.h \
beta.h \
blockgeneration/blockgeneration.h \
blockgeneration/compare.h \
blockgeneration/miner.h \
Expand All @@ -76,6 +77,7 @@ BITCOIN_CORE_H = \
consensus/consensus.h \
consensus/merkle.h \
consensus/params.h \
consensus/tx_verify.h \
consensus/validation.h \
core_io.h \
core_memusage.h \
Expand All @@ -94,6 +96,7 @@ BITCOIN_CORE_H = \
merkleblock.h \
net/addrdb.h \
net/addrman.h \
net/aodv.h \
net/messages.h \
net/net.h \
net/netaddress.h \
Expand All @@ -112,7 +115,6 @@ BITCOIN_CORE_H = \
crypto/pbkdf2.h \
processblock.h \
processheader.h \
processtx.h \
pubkey.h \
random.h \
reverselock.h \
Expand Down Expand Up @@ -177,6 +179,7 @@ libbitcoin_server_a_SOURCES = \
globals.cpp \
threaddeadlock.cpp \
sync.cpp \
beta.cpp \
net/addrdb.cpp \
net/addrman.cpp \
blockgeneration/blockgeneration.cpp \
Expand All @@ -196,6 +199,7 @@ libbitcoin_server_a_SOURCES = \
merkleblock.cpp \
net/net.cpp \
net/netaddress.cpp \
net/aodv.cpp \
policy/fees.cpp \
policy/policy.cpp \
pow.cpp \
Expand All @@ -218,6 +222,7 @@ libbitcoin_server_a_SOURCES = \
coins.cpp \
compressor.cpp \
consensus/merkle.cpp \
consensus/tx_verify.cpp \
core_read.cpp \
core_write.cpp \
crypto/hash.cpp \
Expand All @@ -228,7 +233,6 @@ libbitcoin_server_a_SOURCES = \
chain/blockindex.cpp \
processblock.cpp \
processheader.cpp \
processtx.cpp \
chain/tx.cpp \
net/nodestate.cpp \
net/protocol.cpp \
Expand Down Expand Up @@ -279,6 +283,7 @@ libbitcoin_server_a_SOURCES = \
crypto/scrypt.cpp \
wallet/crypter.cpp \
wallet/db.cpp \
rpc/rpcaodv.cpp \
rpc/rpcdump.cpp \
rpc/rpcwallet.cpp \
wallet/wallet.cpp \
Expand Down
13 changes: 13 additions & 0 deletions src/beta.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// This file is part of the Eccoin project
// Copyright (c) 2019 The Eccoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "beta.h"

std::atomic<bool> fBeta{DEFAULT_BETA_ENABLED};

bool IsBetaEnabled()
{
return fBeta.load();
}
17 changes: 17 additions & 0 deletions src/beta.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// This file is part of the Eccoin project
// Copyright (c) 2019 The Eccoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef ECCOIN_BETA_H
#define ECCOIN_BETA_H

#include <atomic>

static const bool DEFAULT_BETA_ENABLED = false;

extern std::atomic<bool> fBeta;

bool IsBetaEnabled();

#endif
1 change: 1 addition & 0 deletions src/blockgeneration/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "blockgeneration.h"
#include "compare.h"
#include "consensus/consensus.h"
#include "consensus/tx_verify.h"
#include "consensus/validation.h"
#include "crypto/scrypt.h"
#include "init.h"
Expand Down
1 change: 1 addition & 0 deletions src/blockgeneration/minter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "args.h"
#include "blockgeneration.h"
#include "consensus/tx_verify.h"
#include "init.h"
#include "processblock.h"
#include "txmempool.h"
Expand Down
Loading

0 comments on commit eeec970

Please sign in to comment.