aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md5
-rw-r--r--contrib/debian/control36
-rw-r--r--contrib/debian/watch2
-rw-r--r--qa/README.md57
-rwxr-xr-xqa/pull-tester/rpc-tests.py1
-rw-r--r--qa/rpc-tests/README.md49
-rwxr-xr-xqa/rpc-tests/script_test.py259
-rw-r--r--src/httpserver.cpp4
-rw-r--r--src/main.cpp24
-rw-r--r--src/net.cpp1
-rw-r--r--src/net.h1
-rw-r--r--src/qt/guiutil.cpp5
-rw-r--r--src/rpcnet.cpp2
-rw-r--r--src/wallet/rpcwallet.cpp5
14 files changed, 113 insertions, 338 deletions
diff --git a/README.md b/README.md
index c08b2fb0bc..b40ad0e396 100644
--- a/README.md
+++ b/README.md
@@ -49,9 +49,10 @@ lots of money.
### Automated Testing
Developers are strongly encouraged to write unit tests for new code, and to
-submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: `make check`
+submit new unit tests for old code. Unit tests can be compiled and run
+(assuming they weren't disabled in configure) with: `make check`
-There are also regression and integration tests of the RPC interface, written
+There are also [regression and integration tests](/qa) of the RPC interface, written
in Python, that are run automatically on the build server.
These tests can be run with: `qa/pull-tester/rpc-tests.py`
diff --git a/contrib/debian/control b/contrib/debian/control
index 2fd68583ce..490b2571c3 100644
--- a/contrib/debian/control
+++ b/contrib/debian/control
@@ -31,14 +31,11 @@ Package: bitcoind
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: peer-to-peer network based digital currency - daemon
- Bitcoin is a free open source peer-to-peer electronic cash system that
- is completely decentralized, without the need for a central server or
- trusted parties. Users hold the crypto keys to their own money and
- transact directly with each other, with the help of a P2P network to
- check for double-spending.
- .
- Full transaction history is stored locally at each client. This
- requires 20+ GB of space, slowly growing.
+ Bitcoin is an experimental new digital currency that enables instant
+ payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer
+ technology to operate with no central authority: managing transactions
+ and issuing money are carried out collectively by the network. Bitcoin Core
+ is the name of the open source software which enables the use of this currency.
.
This package provides the daemon, bitcoind, and the CLI tool
bitcoin-cli to interact with the daemon.
@@ -47,14 +44,11 @@ Package: bitcoin-qt
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: peer-to-peer network based digital currency - Qt GUI
- Bitcoin is a free open source peer-to-peer electronic cash system that
- is completely decentralized, without the need for a central server or
- trusted parties. Users hold the crypto keys to their own money and
- transact directly with each other, with the help of a P2P network to
- check for double-spending.
- .
- Full transaction history is stored locally at each client. This
- requires 20+ GB of space, slowly growing.
+ Bitcoin is an experimental new digital currency that enables instant
+ payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer
+ technology to operate with no central authority: managing transactions
+ and issuing money are carried out collectively by the network. Bitcoin Core
+ is the name of the open source software which enables the use of this currency.
.
This package provides Bitcoin-Qt, a GUI for Bitcoin based on Qt.
@@ -62,11 +56,11 @@ Package: bitcoin-tx
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: peer-to-peer digital currency - standalone transaction tool
- Bitcoin is a free open source peer-to-peer electronic cash system that
- is completely decentralized, without the need for a central server or
- trusted parties. Users hold the crypto keys to their own money and
- transact directly with each other, with the help of a P2P network to
- check for double-spending.
+ Bitcoin is an experimental new digital currency that enables instant
+ payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer
+ technology to operate with no central authority: managing transactions
+ and issuing money are carried out collectively by the network. Bitcoin Core
+ is the name of the open source software which enables the use of this currency.
.
This package provides bitcoin-tx, a command-line transaction creation
tool which can be used without a bitcoin daemon. Some means of
diff --git a/contrib/debian/watch b/contrib/debian/watch
index c96d2f8e75..4d9e0cfa57 100644
--- a/contrib/debian/watch
+++ b/contrib/debian/watch
@@ -1,7 +1,5 @@
# Run the "uscan" command to check for upstream updates and more.
version=3
# use qa.debian.org redirector; see man uscan
-opts=uversionmangle=s/(\d)(alpha|beta|rc)/$1~$2/;s/\-src//,dversionmangle=s/~dfsg\d*// \
- http://sf.net/bitcoin/bitcoin-(\d.*)-linux\.tar\.gz debian
opts=uversionmangle=s/(\d)(alpha|beta|rc)/$1~$2/,dversionmangle=s/~dfsg\d*// \
http://githubredir.debian.net/github/bitcoin/bitcoin v(.*).tar.gz
diff --git a/qa/README.md b/qa/README.md
new file mode 100644
index 0000000000..758d1f47e5
--- /dev/null
+++ b/qa/README.md
@@ -0,0 +1,57 @@
+The [pull-tester](/qa/pull-tester/) folder contains a script to call
+multiple tests from the [rpc-tests](/qa/rpc-tests/) folder.
+
+Every pull request to the bitcoin repository is built and run through
+the regression test suite. You can also run all or only individual
+tests locally.
+
+Running tests
+=============
+
+You can run any single test by calling `qa/pull-tester/rpc-tests.py <testname>`.
+
+Or you can run any combination of tests by calling `qa/pull-tester/rpc-tests.py <testname1> <testname2> <testname3> ...`
+
+Run the regression test suite with `qa/pull-tester/rpc-tests.py`
+
+Run all possible tests with `qa/pull-tester/rpc-tests.py -extended`
+
+Possible options:
+
+```
+ -h, --help show this help message and exit
+ --nocleanup Leave bitcoinds and test.* datadir on exit or error
+ --noshutdown Don't stop bitcoinds after the test execution
+ --srcdir=SRCDIR Source directory containing bitcoind/bitcoin-cli
+ (default: ../../src)
+ --tmpdir=TMPDIR Root directory for datadirs
+ --tracerpc Print out all RPC calls as they are made
+ --coveragedir=COVERAGEDIR
+ Write tested RPC commands into this directory
+```
+
+If you set the environment variable `PYTHON_DEBUG=1` you will get some debug
+output (example: `PYTHON_DEBUG=1 qa/pull-tester/rpc-tests.py wallet`).
+
+A 200-block -regtest blockchain and wallets for four nodes
+is created the first time a regression test is run and
+is stored in the cache/ directory. Each node has 25 mature
+blocks (25*50=1250 BTC) in its wallet.
+
+After the first run, the cache/ blockchain and wallets are
+copied into a temporary directory and used as the initial
+test state.
+
+If you get into a bad state, you should be able
+to recover with:
+
+```bash
+rm -rf cache
+killall bitcoind
+```
+
+Writing tests
+=============
+You are encouraged to write tests for new or existing features.
+Further information about the test framework and individual rpc
+tests is found in [qa/rpc-tests](/qa/rpc-tests).
diff --git a/qa/pull-tester/rpc-tests.py b/qa/pull-tester/rpc-tests.py
index a02a73cd03..7a30db68dd 100755
--- a/qa/pull-tester/rpc-tests.py
+++ b/qa/pull-tester/rpc-tests.py
@@ -106,7 +106,6 @@ testScriptsExt = [
'invalidateblock.py',
'keypool.py',
# 'rpcbind_test.py', #temporary, bug in libevent, see #6655
-# 'script_test.py', #used for manual comparison of 2 binaries
'smartfees.py',
'maxblocksinflight.py',
'invalidblockrequest.py',
diff --git a/qa/rpc-tests/README.md b/qa/rpc-tests/README.md
index d2db00362f..898931936b 100644
--- a/qa/rpc-tests/README.md
+++ b/qa/rpc-tests/README.md
@@ -1,10 +1,8 @@
Regression tests
================
-### [python-bitcoinrpc](https://github.com/jgarzik/python-bitcoinrpc)
-Git subtree of [https://github.com/jgarzik/python-bitcoinrpc](https://github.com/jgarzik/python-bitcoinrpc).
-Changes to python-bitcoinrpc should be made upstream, and then
-pulled here using git subtree.
+### [test_framework/authproxy.py](test_framework/authproxy.py)
+Taken from the [python-bitcoinrpc repository](https://github.com/jgarzik/python-bitcoinrpc).
### [test_framework/test_framework.py](test_framework/test_framework.py)
Base class for new regression tests.
@@ -33,49 +31,6 @@ Helpers for script.py
### [test_framework/blocktools.py](test_framework/blocktools.py)
Helper functions for creating blocks and transactions.
-
-Notes
-=====
-
-You can run any single test by calling `qa/pull-tester/rpc-tests.py <testname>`.
-
-Or you can run any combination of tests by calling `qa/pull-tester/rpc-tests.py <testname1> <testname2> <testname3> ...`
-
-Run the regression test suite with `qa/pull-tester/rpc-tests.py`
-
-Run all possible tests with `qa/pull-tester/rpc-tests.py -extended`
-
-Possible options:
-
-```
--h, --help show this help message and exit
- --nocleanup Leave bitcoinds and test.* datadir on exit or error
- --noshutdown Don't stop bitcoinds after the test execution
- --srcdir=SRCDIR Source directory containing bitcoind/bitcoin-cli (default:
- ../../src)
- --tmpdir=TMPDIR Root directory for datadirs
- --tracerpc Print out all RPC calls as they are made
-```
-
-If you set the environment variable `PYTHON_DEBUG=1` you will get some debug output (example: `PYTHON_DEBUG=1 qa/pull-tester/rpc-tests.py wallet`).
-
-A 200-block -regtest blockchain and wallets for four nodes
-is created the first time a regression test is run and
-is stored in the cache/ directory. Each node has 25 mature
-blocks (25*50=1250 BTC) in its wallet.
-
-After the first run, the cache/ blockchain and wallets are
-copied into a temporary directory and used as the initial
-test state.
-
-If you get into a bad state, you should be able
-to recover with:
-
-```bash
-rm -rf cache
-killall bitcoind
-```
-
P2P test design notes
---------------------
diff --git a/qa/rpc-tests/script_test.py b/qa/rpc-tests/script_test.py
deleted file mode 100755
index afc44b51b5..0000000000
--- a/qa/rpc-tests/script_test.py
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/env python2
-#
-# Distributed under the MIT/X11 software license, see the accompanying
-# file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#
-
-'''
-Test notes:
-This test uses the script_valid and script_invalid tests from the unittest
-framework to do end-to-end testing where we compare that two nodes agree on
-whether blocks containing a given test script are valid.
-
-We generally ignore the script flags associated with each test (since we lack
-the precision to test each script using those flags in this framework), but
-for tests with SCRIPT_VERIFY_P2SH, we can use a block time after the BIP16
-switchover date to try to test with that flag enabled (and for tests without
-that flag, we use a block time before the switchover date).
-
-NOTE: This test is very slow and may take more than 40 minutes to run.
-'''
-
-from test_framework.test_framework import ComparisonTestFramework
-from test_framework.util import *
-from test_framework.comptool import TestInstance, TestManager
-from test_framework.mininode import *
-from test_framework.blocktools import *
-from test_framework.script import *
-import logging
-import copy
-import json
-
-script_valid_file = "../../src/test/data/script_valid.json"
-script_invalid_file = "../../src/test/data/script_invalid.json"
-
-# Pass in a set of json files to open.
-class ScriptTestFile(object):
-
- def __init__(self, files):
- self.files = files
- self.index = -1
- self.data = []
-
- def load_files(self):
- for f in self.files:
- self.data.extend(json.loads(open(os.path.dirname(os.path.abspath(__file__))+"/"+f).read()))
-
- # Skip over records that are not long enough to be tests
- def get_records(self):
- while (self.index < len(self.data)):
- if len(self.data[self.index]) >= 3:
- yield self.data[self.index]
- self.index += 1
-
-
-# Helper for parsing the flags specified in the .json files
-SCRIPT_VERIFY_NONE = 0
-SCRIPT_VERIFY_P2SH = 1
-SCRIPT_VERIFY_STRICTENC = 1 << 1
-SCRIPT_VERIFY_DERSIG = 1 << 2
-SCRIPT_VERIFY_LOW_S = 1 << 3
-SCRIPT_VERIFY_NULLDUMMY = 1 << 4
-SCRIPT_VERIFY_SIGPUSHONLY = 1 << 5
-SCRIPT_VERIFY_MINIMALDATA = 1 << 6
-SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS = 1 << 7
-SCRIPT_VERIFY_CLEANSTACK = 1 << 8
-
-flag_map = {
- "": SCRIPT_VERIFY_NONE,
- "NONE": SCRIPT_VERIFY_NONE,
- "P2SH": SCRIPT_VERIFY_P2SH,
- "STRICTENC": SCRIPT_VERIFY_STRICTENC,
- "DERSIG": SCRIPT_VERIFY_DERSIG,
- "LOW_S": SCRIPT_VERIFY_LOW_S,
- "NULLDUMMY": SCRIPT_VERIFY_NULLDUMMY,
- "SIGPUSHONLY": SCRIPT_VERIFY_SIGPUSHONLY,
- "MINIMALDATA": SCRIPT_VERIFY_MINIMALDATA,
- "DISCOURAGE_UPGRADABLE_NOPS": SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS,
- "CLEANSTACK": SCRIPT_VERIFY_CLEANSTACK,
-}
-
-def ParseScriptFlags(flag_string):
- flags = 0
- for x in flag_string.split(","):
- if x in flag_map:
- flags |= flag_map[x]
- else:
- print "Error: unrecognized script flag: ", x
- return flags
-
-'''
-Given a string that is a scriptsig or scriptpubkey from the .json files above,
-convert it to a CScript()
-'''
-# Replicates behavior from core_read.cpp
-def ParseScript(json_script):
- script = json_script.split(" ")
- parsed_script = CScript()
- for x in script:
- if len(x) == 0:
- # Empty string, ignore.
- pass
- elif x.isdigit() or (len(x) >= 1 and x[0] == "-" and x[1:].isdigit()):
- # Number
- n = int(x, 0)
- if (n == -1) or (n >= 1 and n <= 16):
- parsed_script = CScript(bytes(parsed_script) + bytes(CScript([n])))
- else:
- parsed_script += CScriptNum(int(x, 0))
- elif x.startswith("0x"):
- # Raw hex data, inserted NOT pushed onto stack:
- for i in xrange(2, len(x), 2):
- parsed_script = CScript(bytes(parsed_script) + bytes(chr(int(x[i:i+2],16))))
- elif x.startswith("'") and x.endswith("'") and len(x) >= 2:
- # Single-quoted string, pushed as data.
- parsed_script += CScript([x[1:-1]])
- else:
- # opcode, e.g. OP_ADD or ADD:
- tryopname = "OP_" + x
- if tryopname in OPCODES_BY_NAME:
- parsed_script += CScriptOp(OPCODES_BY_NAME["OP_" + x])
- else:
- print "ParseScript: error parsing '%s'" % x
- return ""
- return parsed_script
-
-class TestBuilder(object):
- def create_credit_tx(self, scriptPubKey, height):
- # self.tx1 is a coinbase transaction, modeled after the one created by script_tests.cpp
- # This allows us to reuse signatures created in the unit test framework.
- self.tx1 = create_coinbase(height) # this has a bip34 scriptsig,
- self.tx1.vin[0].scriptSig = CScript([0, 0]) # but this matches the unit tests
- self.tx1.vout[0].nValue = 0
- self.tx1.vout[0].scriptPubKey = scriptPubKey
- self.tx1.rehash()
- def create_spend_tx(self, scriptSig):
- self.tx2 = create_transaction(self.tx1, 0, CScript(), 0)
- self.tx2.vin[0].scriptSig = scriptSig
- self.tx2.vout[0].scriptPubKey = CScript()
- self.tx2.rehash()
- def rehash(self):
- self.tx1.rehash()
- self.tx2.rehash()
-
-# This test uses the (default) two nodes provided by ComparisonTestFramework,
-# specified on the command line with --testbinary and --refbinary.
-# See comptool.py
-class ScriptTest(ComparisonTestFramework):
-
- def run_test(self):
- # Set up the comparison tool TestManager
- test = TestManager(self, self.options.tmpdir)
- test.add_all_connections(self.nodes)
-
- # Load scripts
- self.scripts = ScriptTestFile([script_valid_file, script_invalid_file])
- self.scripts.load_files()
-
- # Some variables we re-use between test instances (to build blocks)
- self.tip = None
- self.block_time = None
-
- NetworkThread().start() # Start up network handling in another thread
- test.run()
-
- def generate_test_instance(self, pubkeystring, scriptsigstring):
- scriptpubkey = ParseScript(pubkeystring)
- scriptsig = ParseScript(scriptsigstring)
-
- test = TestInstance(sync_every_block=False)
- test_build = TestBuilder()
- test_build.create_credit_tx(scriptpubkey, self.height)
- test_build.create_spend_tx(scriptsig)
- test_build.rehash()
-
- block = create_block(self.tip, test_build.tx1, self.block_time)
- self.block_time += 1
- block.solve()
- self.tip = block.sha256
- self.height += 1
- test.blocks_and_transactions = [[block, True]]
-
- for i in xrange(100):
- block = create_block(self.tip, create_coinbase(self.height), self.block_time)
- self.block_time += 1
- block.solve()
- self.tip = block.sha256
- self.height += 1
- test.blocks_and_transactions.append([block, True])
-
- block = create_block(self.tip, create_coinbase(self.height), self.block_time)
- self.block_time += 1
- block.vtx.append(test_build.tx2)
- block.hashMerkleRoot = block.calc_merkle_root()
- block.rehash()
- block.solve()
- test.blocks_and_transactions.append([block, None])
- return test
-
- # This generates the tests for TestManager.
- def get_tests(self):
- self.tip = int ("0x" + self.nodes[0].getbestblockhash() + "L", 0)
- self.block_time = 1333230000 # before the BIP16 switchover
- self.height = 1
-
- '''
- Create a new block with an anyone-can-spend coinbase
- '''
- block = create_block(self.tip, create_coinbase(self.height), self.block_time)
- self.block_time += 1
- block.solve()
- self.tip = block.sha256
- self.height += 1
- yield TestInstance(objects=[[block, True]])
-
- '''
- Build out to 100 blocks total, maturing the coinbase.
- '''
- test = TestInstance(objects=[], sync_every_block=False, sync_every_tx=False)
- for i in xrange(100):
- b = create_block(self.tip, create_coinbase(self.height), self.block_time)
- b.solve()
- test.blocks_and_transactions.append([b, True])
- self.tip = b.sha256
- self.block_time += 1
- self.height += 1
- yield test
-
- ''' Iterate through script tests. '''
- counter = 0
- for script_test in self.scripts.get_records():
- ''' Reset the blockchain to genesis block + 100 blocks. '''
- if self.nodes[0].getblockcount() > 101:
- self.nodes[0].invalidateblock(self.nodes[0].getblockhash(102))
- self.nodes[1].invalidateblock(self.nodes[1].getblockhash(102))
-
- self.tip = int ("0x" + self.nodes[0].getbestblockhash() + "L", 0)
- self.height = 102
-
- [scriptsig, scriptpubkey, flags] = script_test[0:3]
- flags = ParseScriptFlags(flags)
-
- # We can use block time to determine whether the nodes should be
- # enforcing BIP16.
- #
- # We intentionally let the block time grow by 1 each time.
- # This forces the block hashes to differ between tests, so that
- # a call to invalidateblock doesn't interfere with a later test.
- if (flags & SCRIPT_VERIFY_P2SH):
- self.block_time = 1333238400 + counter # Advance to enforcing BIP16
- else:
- self.block_time = 1333230000 + counter # Before the BIP16 switchover
-
- print "Script test: [%s]" % script_test
-
- yield self.generate_test_instance(scriptpubkey, scriptsig)
- counter += 1
-
-if __name__ == '__main__':
- ScriptTest().main()
diff --git a/src/httpserver.cpp b/src/httpserver.cpp
index 52f5675e85..91518d7c5f 100644
--- a/src/httpserver.cpp
+++ b/src/httpserver.cpp
@@ -487,7 +487,11 @@ void StopHTTPServer()
// master that appears to be solved, so in the future that solution
// could be used again (if desirable).
// (see discussion in https://github.com/bitcoin/bitcoin/pull/6990)
+#if BOOST_VERSION >= 105000
if (!threadHTTP.try_join_for(boost::chrono::milliseconds(2000))) {
+#else
+ if (!threadHTTP.timed_join(boost::posix_time::milliseconds(2000))) {
+#endif
LogPrintf("HTTP event loop did not exit within allotted time, sending loopbreak\n");
event_base_loopbreak(eventBase);
threadHTTP.join();
diff --git a/src/main.cpp b/src/main.cpp
index 439314f43b..2579b642b8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4211,6 +4211,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
return error("message inv size() = %u", vInv.size());
}
+ bool fBlocksOnly = GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY);
+
+ // Allow whitelisted peers to send data other than blocks in blocks only mode if whitelistalwaysrelay is true
+ if (pfrom->fWhitelisted && GetBoolArg("-whitelistalwaysrelay", DEFAULT_WHITELISTALWAYSRELAY))
+ fBlocksOnly = false;
+
LOCK(cs_main);
std::vector<CInv> vToFetch;
@@ -4225,9 +4231,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
bool fAlreadyHave = AlreadyHave(inv);
LogPrint("net", "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom->id);
- if (!fAlreadyHave && !fImporting && !fReindex && inv.type != MSG_BLOCK && !GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY))
- pfrom->AskFor(inv);
-
if (inv.type == MSG_BLOCK) {
UpdateBlockAvailability(pfrom->GetId(), inv.hash);
if (!fAlreadyHave && !fImporting && !fReindex && !mapBlocksInFlight.count(inv.hash)) {
@@ -4251,6 +4254,13 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
LogPrint("net", "getheaders (%d) %s to peer=%d\n", pindexBestHeader->nHeight, inv.hash.ToString(), pfrom->id);
}
}
+ else
+ {
+ if (fBlocksOnly)
+ LogPrint("net", "transaction (%s) inv sent in violation of protocol peer=%d\n", inv.hash.ToString(), pfrom->id);
+ else if (!fAlreadyHave && !fImporting && !fReindex)
+ pfrom->AskFor(inv);
+ }
// Track requests for our stuff
GetMainSignals().Inventory(inv.hash);
@@ -4375,6 +4385,14 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
else if (strCommand == "tx")
{
+ // Stop processing the transaction early if
+ // We are in blocks only mode and peer is either not whitelisted or whitelistalwaysrelay is off
+ if (GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && (!pfrom->fWhitelisted || !GetBoolArg("-whitelistalwaysrelay", DEFAULT_WHITELISTALWAYSRELAY)))
+ {
+ LogPrint("net", "transaction sent in violation of protocol peer=%d\n", pfrom->id);
+ return true;
+ }
+
vector<uint256> vWorkQueue;
vector<uint256> vEraseQueue;
CTransaction tx;
diff --git a/src/net.cpp b/src/net.cpp
index 000eefc858..cff4c54505 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -617,6 +617,7 @@ void CNode::copyStats(CNodeStats &stats)
{
stats.nodeid = this->GetId();
X(nServices);
+ X(fRelayTxes);
X(nLastSend);
X(nLastRecv);
X(nTimeConnected);
diff --git a/src/net.h b/src/net.h
index ebdbe77565..559cdf0878 100644
--- a/src/net.h
+++ b/src/net.h
@@ -180,6 +180,7 @@ class CNodeStats
public:
NodeId nodeid;
uint64_t nServices;
+ bool fRelayTxes;
int64_t nLastSend;
int64_t nLastRecv;
int64_t nTimeConnected;
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 845459b76a..6dce9370d7 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -681,7 +681,10 @@ boost::filesystem::path static GetAutostartDir()
boost::filesystem::path static GetAutostartFilePath()
{
- return GetAutostartDir() / "bitcoin.desktop";
+ std::string chain = ChainNameFromCommandLine();
+ if (chain == CBaseChainParams::MAIN)
+ return GetAutostartDir() / "bitcoin.desktop";
+ return GetAutostartDir() / strprintf("bitcoin-%s.lnk", chain);
}
bool GetStartOnSystemStartup()
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp
index 8915010649..2578848891 100644
--- a/src/rpcnet.cpp
+++ b/src/rpcnet.cpp
@@ -90,6 +90,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp)
" \"addr\":\"host:port\", (string) The ip address and port of the peer\n"
" \"addrlocal\":\"ip:port\", (string) local address\n"
" \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services offered\n"
+ " \"relaytxes\":true|false, (boolean) Whether peer has asked us to relay transactions to it\n"
" \"lastsend\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send\n"
" \"lastrecv\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive\n"
" \"bytessent\": n, (numeric) The total bytes sent\n"
@@ -134,6 +135,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp)
if (!(stats.addrLocal.empty()))
obj.push_back(Pair("addrlocal", stats.addrLocal));
obj.push_back(Pair("services", strprintf("%016x", stats.nServices)));
+ obj.push_back(Pair("relaytxes", stats.fRelayTxes));
obj.push_back(Pair("lastsend", stats.nLastSend));
obj.push_back(Pair("lastrecv", stats.nLastRecv));
obj.push_back(Pair("bytessent", stats.nSendBytes));
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 84881226c4..b6eaca80b3 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -1417,7 +1417,7 @@ UniValue listtransactions(const UniValue& params, bool fHelp)
" \"amount\": x.xxx, (numeric) The amount in " + CURRENCY_UNIT + ". This is negative for the 'send' category, and for the\n"
" 'move' category for moves outbound. It is positive for the 'receive' category,\n"
" and for the 'move' category for inbound funds.\n"
- " \"vout\" : n, (numeric) the vout value\n"
+ " \"vout\": n, (numeric) the vout value\n"
" \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
" 'send' category of transactions.\n"
" \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and \n"
@@ -1426,12 +1426,13 @@ UniValue listtransactions(const UniValue& params, bool fHelp)
" category of transactions.\n"
" \"blockindex\": n, (numeric) The block index containing the transaction. Available for 'send' and 'receive'\n"
" category of transactions.\n"
+ " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n"
" \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n"
" \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n"
" \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT). Available \n"
" for 'send' and 'receive' category of transactions.\n"
" \"comment\": \"...\", (string) If a comment is associated with the transaction.\n"
- " \"label\" : \"label\" (string) A comment for the address/transaction, if any\n"
+ " \"label\": \"label\" (string) A comment for the address/transaction, if any\n"
" \"otheraccount\": \"accountname\", (string) For the 'move' category of transactions, the account the funds came \n"
" from (for receiving funds, positive amounts), or went to (for sending funds,\n"
" negative amounts).\n"