Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2933334
Merge #8981: Wshadow: Do not shadow argument with a local variable
laanwj Nov 7, 2016
2342b2a
Merge #9094: qt: Use correct conversion function for boost::path datadir
jonasschnelli Nov 7, 2016
3d7bb9c
Merge #9077: [qa] Increase wallet-dump RPC timeout
Nov 7, 2016
9b8cc0b
Merge #9045: Hash P2P messages as they are received instead of at pro…
sipa Nov 7, 2016
705057f
Merge #9095: test: Fix test_random includes
jonasschnelli Nov 8, 2016
1121f2f
Merge #9098: [qa] Handle zombies and cluttered tmpdirs
laanwj Nov 8, 2016
19a2d66
Merge #9039: Various serialization simplifcations and optimizations
laanwj Nov 9, 2016
7765c87
Remove nType and nVersion from Dash related serialization code
codablock Sep 19, 2017
5917290
Merge #8794: Enable -Wshadow by default
laanwj Nov 9, 2016
b64452a
Revert "Check and enable -Wshadow by default."
laanwj Nov 9, 2016
161fa91
Merge #9111: Remove unused variable UNLIKELY_PCT from fees.h
laanwj Nov 9, 2016
56ed800
Merge #8894: [Testing] Include fRelay in mininode version messages
laanwj Nov 9, 2016
5f69086
Merge #9121: Initialize variable to prevent compiler warning
laanwj Nov 10, 2016
ec08f5b
Merge #9122: fix getnettotals RPC description about timemillis.
Nov 10, 2016
3a388d9
Merge #9097: [qa] Rework sync_* and preciousblock.py
Nov 10, 2016
a9aa477
Merge #9049: Remove duplicatable duplicate-input check from CheckTran…
laanwj Nov 10, 2016
8b7eeb6
Merge #9115: Mention reporting security issues responsibly
laanwj Nov 11, 2016
db516cf
Merge #9124: Use better name for local variable to prevent -Wshadow c…
laanwj Nov 11, 2016
2b99a4b
Merge #9145: [qt] Make network disabled icon 50% opaque
jonasschnelli Nov 14, 2016
12883cf
Merge #9136: sync_blocks cleanup
Nov 14, 2016
a9c3544
Merge #9140: Bugfix: Correctly replace generated headers and fail cle…
laanwj Nov 15, 2016
c12eb7f
Put namespace{} around alertTests.raw.h include
codablock Sep 19, 2017
dc4fdd9
Merge #9164: [trivial] credit values are CAmount
sipa Nov 15, 2016
e711f4a
Merge #9151: [qa] proxy_test: Calculate hardcoded port numbers
laanwj Nov 16, 2016
0932079
Merge #9131: fNetworkActive is not protected by a lock, use an atomic
laanwj Nov 16, 2016
9b9d3d1
Merge #9133: Unset fImporting for loading mempool
laanwj Nov 16, 2016
a9a2db9
Merge #9168: [qa] add assert_raises_message to check specific error m…
Nov 16, 2016
2f95284
Merge #9156: Add compile and link options echo to configure
laanwj Nov 17, 2016
c937a0b
Merge #9186: test: Fix use-after-free in scheduler tests
laanwj Nov 19, 2016
f12610c
Merge #9125: Make CBlock a vector of shared_ptr of CTransactions
laanwj Nov 21, 2016
afa99c4
Merge #9117: net: don't send feefilter messages before the version ha…
laanwj Nov 21, 2016
726dd1f
Merge #9179: Set DEFAULT_LIMITFREERELAY = 0 kB/minute
laanwj Nov 21, 2016
e5cc7d0
Merge #8872: Remove block-request logic from INV message processing
laanwj Nov 21, 2016
507c4e5
Merge #9185: [Qt] fix coincontrol sort issue
jonasschnelli Nov 22, 2016
481bab7
Merge #9200: bench: Fix subtle counting issue when rescaling iteratio…
laanwj Nov 22, 2016
ce3f38d
Merge #9025: getrawtransaction should take a bool for verbose
laanwj Nov 23, 2016
4e1c192
Merge #9142: Move -salvagewallet, -zap(wtx) to where they belong
laanwj Nov 23, 2016
d757c89
Merge #9141: Remove unnecessary calls to CheckFinalTx
laanwj Nov 23, 2016
2d87a0f
Merge #8690: Do not fully sort all nodes for addr relay
laanwj Nov 23, 2016
898bd43
Merge #9204: Clarify CreateTransaction error messages
laanwj Nov 23, 2016
796bed1
Merge #9207: [Doc] Move comments above bash command in build-unix
laanwj Nov 23, 2016
e02f313
Mogrify and optimize network_disabled.png and copy it to all themes
codablock Jan 15, 2018
07cd44c
Use MakeTransactionRef in CreateDevNetGenesisBlock
codablock Jan 15, 2018
76d7730
Dashify ISSUE_TEMPLATE.md
codablock Jan 15, 2018
9170c0e
Fix rpc tests
codablock Jan 15, 2018
d0a39fb
Use "Dash Core" instead of "dash-core" in some places and Dashify
codablock Jan 16, 2018
7939a23
Use std::move when calling MakeTransactionRef
codablock Jan 16, 2018
b6ea01e
Remove namespace alert_tests when including alert test data
codablock Jan 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<!--- Remove sections that do not apply -->

This issue tracker is only for technical issues related to bitcoin-core.
This issue tracker is only for technical issues related to Dash Core.

General bitcoin questions and/or support requests and are best directed to the [Bitcoin StackExchange](https://bitcoin.stackexchange.com).
General Dash questions and/or support requests and are best directed to the [Dashpay Reddit](https://www.reddit.com/r/dashpay/).

To report critical security issues, email infosec@dash.org instead of creating Github issues.

### Describe the issue

Expand All @@ -21,7 +23,7 @@ Tell us what happens instead
### Screenshots.
If the issue is related to the GUI, screenshots can be added to this issue via drag & drop.

### What version of bitcoin-core are you using?
### What version of Dash Core are you using?
List the version number/commit ID, and if it is an official binary, self compiled or a distribution package such as PPA.

### Machine specs:
Expand Down
25 changes: 25 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1135,3 +1135,28 @@ case ${OS} in
mv qa/pull-tester/tests_config-2.py qa/pull-tester/tests_config.py
;;
esac

echo
echo "Options used to compile and link:"
echo " with wallet = $enable_wallet"
echo " with gui / qt = $bitcoin_enable_qt"
if test x$bitcoin_enable_qt != xno; then
echo " qt version = $bitcoin_qt_got_major_vers"
echo " with qr = $use_qr"
fi
echo " with zmq = $use_zmq"
echo " with test = $use_tests"
echo " with bench = $use_bench"
echo " with upnp = $use_upnp"
echo " debug enabled = $enable_debug"
echo
echo " target os = $TARGET_OS"
echo " build os = $BUILD_OS"
echo
echo " CC = $CC"
echo " CFLAGS = $CFLAGS"
echo " CPPFLAGS = $CPPFLAGS"
echo " CXX = $CXX"
echo " CXXFLAGS = $CXXFLAGS"
echo " LDFLAGS = $LDFLAGS"
echo
2 changes: 1 addition & 1 deletion doc/benchmarking.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Benchmarking
Dash Core has an internal benchmarking framework, with benchmarks
for cryptographic algorithms such as SHA1, SHA256, SHA512 and RIPEMD160. As well as the rolling bloom filter.

After compiling dash-core, the benchmarks can be run with:
After compiling Dash Core, the benchmarks can be run with:
`src/bench/bench_dash`

The output will look similar to:
Expand Down
8 changes: 4 additions & 4 deletions doc/build-unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ pass `--with-incompatible-bdb` to configure.

See the section "Disable-wallet mode" to build Dash Core without wallet.

Optional:
Optional (see --with-miniupnpc and --enable-upnp-default):

sudo apt-get install libminiupnpc-dev (see --with-miniupnpc and --enable-upnp-default)
sudo apt-get install libminiupnpc-dev

ZMQ dependencies:
ZMQ dependencies (provides ZMQ API 4.x):

sudo apt-get install libzmq3-dev (provides ZMQ API 4.x)
sudo apt-get install libzmq3-dev

Dependencies for the GUI: Ubuntu & Debian
-----------------------------------------
Expand Down
26 changes: 26 additions & 0 deletions doc/developer-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,32 @@ Strings and formatting

- *Rationale*: Dash Core uses tinyformat, which is type safe. Leave them out to avoid confusion

Variable names
--------------

The shadowing warning (`-Wshadow`) is enabled by default. It prevents issues rising
from using a different variable with the same name.

Please name variables so that their names do not shadow variables defined in the source code.

E.g. in member initializers, prepend `_` to the argument name shadowing the
member name:

```c++
class AddressBookPage
{
Mode mode;
}

AddressBookPage::AddressBookPage(Mode _mode) :
mode(_mode)
...
```

When using nested cycles, do not name the inner cycle variable the same as in
upper cycle etc.


Threads and synchronization
----------------------------

Expand Down
6 changes: 5 additions & 1 deletion qa/pull-tester/rpc-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,18 @@ def __init__(self, num_tests_parallel, test_list=None, flags=None):
self.test_list = test_list
self.flags = flags
self.num_running = 0
# In case there is a graveyard of zombie bitcoinds, we can apply a
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we dashify bitcoinds here?

Copy link
Author

@codablock codablock Jan 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We normally don't Dashify source comments. Only user facing strings and documentation is Dashified.

# pseudorandom offset to hopefully jump over them.
# (625 is PORT_RANGE/MAX_NODES)
self.portseed_offset = int(time.time() * 1000) % 625
self.jobs = []

def get_next(self):
while self.num_running < self.num_jobs and self.test_list:
# Add tests
self.num_running += 1
t = self.test_list.pop(0)
port_seed = ["--portseed=%s" % len(self.test_list)]
port_seed = ["--portseed={}".format(len(self.test_list) + self.portseed_offset)]
log_stdout = tempfile.SpooledTemporaryFile(max_size=2**16)
log_stderr = tempfile.SpooledTemporaryFile(max_size=2**16)
self.jobs.append((t,
Expand Down
12 changes: 6 additions & 6 deletions qa/rpc-tests/mempool_reorg.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ def run_test(self):
# and make sure the mempool code behaves correctly.
b = [ self.nodes[0].getblockhash(n) for n in range(101, 105) ]
coinbase_txids = [ self.nodes[0].getblock(h)['tx'][0] for h in b ]
spend_101_raw = create_tx(self.nodes[0], coinbase_txids[1], node1_address, 500)
spend_102_raw = create_tx(self.nodes[0], coinbase_txids[2], node0_address, 500)
spend_103_raw = create_tx(self.nodes[0], coinbase_txids[3], node0_address, 500)
spend_101_raw = create_tx(self.nodes[0], coinbase_txids[1], node1_address, 499.9)
spend_102_raw = create_tx(self.nodes[0], coinbase_txids[2], node0_address, 499.9)
spend_103_raw = create_tx(self.nodes[0], coinbase_txids[3], node0_address, 499.9)

# Create a block-height-locked transaction which will be invalid after reorg
timelock_tx = self.nodes[0].createrawtransaction([{"txid": coinbase_txids[0], "vout": 0}], {node0_address: 500})
timelock_tx = self.nodes[0].createrawtransaction([{"txid": coinbase_txids[0], "vout": 0}], {node0_address: 499.9})
# Set the time lock
timelock_tx = timelock_tx.replace("ffffffff", "11111111", 1)
timelock_tx = timelock_tx[:-8] + hex(self.nodes[0].getblockcount() + 2)[2:] + "000000"
Expand All @@ -67,8 +67,8 @@ def run_test(self):
assert_raises(JSONRPCException, self.nodes[0].sendrawtransaction, timelock_tx)

# Create 102_1 and 103_1:
spend_102_1_raw = create_tx(self.nodes[0], spend_102_id, node1_address, 500)
spend_103_1_raw = create_tx(self.nodes[0], spend_103_id, node1_address, 500)
spend_102_1_raw = create_tx(self.nodes[0], spend_102_id, node1_address, 499.8)
spend_103_1_raw = create_tx(self.nodes[0], spend_103_id, node1_address, 499.8)

# Broadcast and mine 103_1:
spend_103_1_id = self.nodes[0].sendrawtransaction(spend_103_1_raw)
Expand Down
65 changes: 34 additions & 31 deletions qa/rpc-tests/preciousblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
#

from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.util import (
assert_equal,
connect_nodes_bi,
sync_chain,
sync_blocks,
)

def unidirectional_node_sync_via_rpc(node_src, node_dest):
blocks_to_copy = []
Expand All @@ -33,84 +38,82 @@ def node_sync_via_rpc(nodes):
unidirectional_node_sync_via_rpc(node_src, node_dest)

class PreciousTest(BitcoinTestFramework):
def setup_chain(self):
print("Initializing test directory "+self.options.tmpdir)
initialize_chain_clean(self.options.tmpdir, 3)
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.num_nodes = 3
self.extra_args = [["-debug"]] * self.num_nodes

def setup_network(self):
self.nodes = []
self.is_network_split = False
self.nodes.append(start_node(0, self.options.tmpdir, ["-debug"]))
self.nodes.append(start_node(1, self.options.tmpdir, ["-debug"]))
self.nodes.append(start_node(2, self.options.tmpdir, ["-debug"]))
self.nodes = self.setup_nodes()

def run_test(self):
print("Ensure submitblock can in principle reorg to a competing chain")
self.nodes[0].generate(1)
assert(self.nodes[0].getblockcount() == 1)
assert_equal(self.nodes[0].getblockcount(), 1)
(hashY, hashZ) = self.nodes[1].generate(2)
assert(self.nodes[1].getblockcount() == 2)
assert_equal(self.nodes[1].getblockcount(), 2)
node_sync_via_rpc(self.nodes[0:3])
assert(self.nodes[0].getbestblockhash() == hashZ)
assert_equal(self.nodes[0].getbestblockhash(), hashZ)

print("Mine blocks A-B-C on Node 0")
(hashA, hashB, hashC) = self.nodes[0].generate(3)
assert(self.nodes[0].getblockcount() == 5)
assert_equal(self.nodes[0].getblockcount(), 5)
print("Mine competing blocks E-F-G on Node 1")
(hashE, hashF, hashG) = self.nodes[1].generate(3)
assert(self.nodes[1].getblockcount() == 5)
assert_equal(self.nodes[1].getblockcount(), 5)
assert(hashC != hashG)
print("Connect nodes and check no reorg occurs")
# Submit competing blocks via RPC so any reorg should occur before we proceed (no way to wait on inaction for p2p sync)
node_sync_via_rpc(self.nodes[0:2])
connect_nodes_bi(self.nodes,0,1)
assert(self.nodes[0].getbestblockhash() == hashC)
assert(self.nodes[1].getbestblockhash() == hashG)
assert_equal(self.nodes[0].getbestblockhash(), hashC)
assert_equal(self.nodes[1].getbestblockhash(), hashG)
print("Make Node0 prefer block G")
self.nodes[0].preciousblock(hashG)
assert(self.nodes[0].getbestblockhash() == hashG)
assert_equal(self.nodes[0].getbestblockhash(), hashG)
print("Make Node0 prefer block C again")
self.nodes[0].preciousblock(hashC)
assert(self.nodes[0].getbestblockhash() == hashC)
assert_equal(self.nodes[0].getbestblockhash(), hashC)
print("Make Node1 prefer block C")
self.nodes[1].preciousblock(hashC)
sync_chain(self.nodes[0:2]) # wait because node 1 may not have downloaded hashC
assert(self.nodes[1].getbestblockhash() == hashC)
assert_equal(self.nodes[1].getbestblockhash(), hashC)
print("Make Node1 prefer block G again")
self.nodes[1].preciousblock(hashG)
assert(self.nodes[1].getbestblockhash() == hashG)
assert_equal(self.nodes[1].getbestblockhash(), hashG)
print("Make Node0 prefer block G again")
self.nodes[0].preciousblock(hashG)
assert(self.nodes[0].getbestblockhash() == hashG)
assert_equal(self.nodes[0].getbestblockhash(), hashG)
print("Make Node1 prefer block C again")
self.nodes[1].preciousblock(hashC)
assert(self.nodes[1].getbestblockhash() == hashC)
assert_equal(self.nodes[1].getbestblockhash(), hashC)
print("Mine another block (E-F-G-)H on Node 0 and reorg Node 1")
self.nodes[0].generate(1)
assert(self.nodes[0].getblockcount() == 6)
assert_equal(self.nodes[0].getblockcount(), 6)
sync_blocks(self.nodes[0:2])
hashH = self.nodes[0].getbestblockhash()
assert(self.nodes[1].getbestblockhash() == hashH)
assert_equal(self.nodes[1].getbestblockhash(), hashH)
print("Node1 should not be able to prefer block C anymore")
self.nodes[1].preciousblock(hashC)
assert(self.nodes[1].getbestblockhash() == hashH)
assert_equal(self.nodes[1].getbestblockhash(), hashH)
print("Mine competing blocks I-J-K-L on Node 2")
self.nodes[2].generate(4)
assert(self.nodes[2].getblockcount() == 6)
assert_equal(self.nodes[2].getblockcount(), 6)
hashL = self.nodes[2].getbestblockhash()
print("Connect nodes and check no reorg occurs")
node_sync_via_rpc(self.nodes[0:3])
connect_nodes_bi(self.nodes,1,2)
connect_nodes_bi(self.nodes,0,2)
assert(self.nodes[0].getbestblockhash() == hashH)
assert(self.nodes[1].getbestblockhash() == hashH)
assert(self.nodes[2].getbestblockhash() == hashL)
assert_equal(self.nodes[0].getbestblockhash(), hashH)
assert_equal(self.nodes[1].getbestblockhash(), hashH)
assert_equal(self.nodes[2].getbestblockhash(), hashL)
print("Make Node1 prefer block L")
self.nodes[1].preciousblock(hashL)
assert(self.nodes[1].getbestblockhash() == hashL)
assert_equal(self.nodes[1].getbestblockhash(), hashL)
print("Make Node2 prefer block H")
self.nodes[2].preciousblock(hashH)
assert(self.nodes[2].getbestblockhash() == hashH)
assert_equal(self.nodes[2].getbestblockhash(), hashH)

if __name__ == '__main__':
PreciousTest().main()
16 changes: 12 additions & 4 deletions qa/rpc-tests/proxy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

import socket
import os

from test_framework.socks5 import Socks5Configuration, Socks5Command, Socks5Server, AddressType
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.util import (
PORT_MIN,
PORT_RANGE,
start_nodes,
assert_equal,
)
from test_framework.netutil import test_ipv6_local
'''
Test plan:
Expand All @@ -33,6 +39,8 @@
addnode connect to generic DNS name
'''

RANGE_BEGIN = PORT_MIN + 2 * PORT_RANGE # Start after p2p and rpc ports


class ProxyTest(BitcoinTestFramework):
def __init__(self):
Expand All @@ -44,19 +52,19 @@ def __init__(self):
# Create two proxies on different ports
# ... one unauthenticated
self.conf1 = Socks5Configuration()
self.conf1.addr = ('127.0.0.1', 13000 + (os.getpid() % 1000))
self.conf1.addr = ('127.0.0.1', RANGE_BEGIN + (os.getpid() % 1000))
self.conf1.unauth = True
self.conf1.auth = False
# ... one supporting authenticated and unauthenticated (Tor)
self.conf2 = Socks5Configuration()
self.conf2.addr = ('127.0.0.1', 14000 + (os.getpid() % 1000))
self.conf2.addr = ('127.0.0.1', RANGE_BEGIN + 1000 + (os.getpid() % 1000))
self.conf2.unauth = True
self.conf2.auth = True
if self.have_ipv6:
# ... one on IPv6 with similar configuration
self.conf3 = Socks5Configuration()
self.conf3.af = socket.AF_INET6
self.conf3.addr = ('::1', 15000 + (os.getpid() % 1000))
self.conf3.addr = ('::1', RANGE_BEGIN + 2000 + (os.getpid() % 1000))
self.conf3.unauth = True
self.conf3.auth = True
else:
Expand Down
39 changes: 35 additions & 4 deletions qa/rpc-tests/rawtransactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""rawtranscation RPCs QA test.

#
# Test re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly) coinbase transactions.
#
# Tests the following RPCs:
# - createrawtransaction
# - signrawtransaction
# - sendrawtransaction
# - decoderawtransaction
# - getrawtransaction
"""

from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
Expand Down Expand Up @@ -138,6 +142,33 @@ def run_test(self):
self.sync_all()
assert_equal(self.nodes[0].getbalance(), bal+Decimal('500.00000000')+Decimal('2.19000000')) #block reward + tx

# getrawtransaction tests
# 1. valid parameters - only supply txid
txHash = rawTx["txid"]
assert_equal(self.nodes[0].getrawtransaction(txHash), rawTxSigned['hex'])

# 2. valid parameters - supply txid and 0 for non-verbose
assert_equal(self.nodes[0].getrawtransaction(txHash, 0), rawTxSigned['hex'])

# 3. valid parameters - supply txid and False for non-verbose
assert_equal(self.nodes[0].getrawtransaction(txHash, False), rawTxSigned['hex'])

# 4. valid parameters - supply txid and 1 for verbose.
# We only check the "hex" field of the output so we don't need to update this test every time the output format changes.
assert_equal(self.nodes[0].getrawtransaction(txHash, 1)["hex"], rawTxSigned['hex'])

# 5. valid parameters - supply txid and True for non-verbose
assert_equal(self.nodes[0].getrawtransaction(txHash, True)["hex"], rawTxSigned['hex'])

# 6. invalid parameters - supply txid and string "Flase"
assert_raises(JSONRPCException, self.nodes[0].getrawtransaction, txHash, "Flase")

# 7. invalid parameters - supply txid and empty array
assert_raises(JSONRPCException, self.nodes[0].getrawtransaction, txHash, [])

# 8. invalid parameters - supply txid and empty dict
assert_raises(JSONRPCException, self.nodes[0].getrawtransaction, txHash, {})

inputs = [ {'txid' : "1d1d4e24ed99057e84c3f80fd8fbec79ed9e1acee37da269356ecea000000000", 'vout' : 1, 'sequence' : 1000}]
outputs = { self.nodes[0].getnewaddress() : 1 }
rawtx = self.nodes[0].createrawtransaction(inputs, outputs)
Expand Down
Loading