Skip to content

Commit d60d54d

Browse files
ロハン ダルロハン ダル
authored andcommitted
merge with bitcoin core
2 parents 64aa36e + 61a640e commit d60d54d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2923
-1008
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fixes or code moves with actual code changes.
3838
Commit messages should be verbose by default consisting of a short subject line
3939
(50 chars max), a blank line and detailed explanatory text as separate
4040
paragraph(s); unless the title alone is self-explanatory (like "Corrected typo
41-
in main.cpp") then a single title line is sufficient. Commit messages should be
41+
in init.cpp") then a single title line is sufficient. Commit messages should be
4242
helpful to people reading your code in the future, so explain the reasoning for
4343
your decisions. Further explanation [here](http://chris.beams.io/posts/git-commit/).
4444

@@ -79,7 +79,7 @@ Examples:
7979
Consensus: Add new opcode for BIP-XXXX OP_CHECKAWESOMESIG
8080
Net: Automatically create hidden service, listen on Tor
8181
Qt: Add feed bump button
82-
Trivial: Fix typo in main.cpp
82+
Trivial: Fix typo in init.cpp
8383

8484
If a pull request is specifically not to be considered for merging (yet) please
8585
prefix the title with [WIP] or use [Tasks Lists](https://help.github.com/articles/basic-writing-and-formatting-syntax/#task-lists)
@@ -194,7 +194,7 @@ request. Typically reviewers will review the code for obvious errors, as well as
194194
test out the patch set and opine on the technical merits of the patch. Project
195195
maintainers take into account the peer review when determining if there is
196196
consensus to merge a pull request (remember that discussions may have been
197-
spread out over github, mailing list and IRC discussions). The following
197+
spread out over GitHub, mailing list and IRC discussions). The following
198198
language is used within pull-request comments:
199199

200200
- ACK means "I have tested the code and I agree it should be merged";

Makefile.am

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,6 @@ EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.py qa/rpc-
227227

228228
CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
229229

230-
# This file is problematic for out-of-tree builds if it exists.
231-
DISTCLEANFILES = qa/pull-tester/tests_config.pyc
232-
233230
.INTERMEDIATE: $(COVERAGE_INFO)
234231

235232
DISTCHECK_CONFIGURE_FLAGS = --enable-man

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
22
AC_PREREQ([2.60])
33
define(_CLIENT_VERSION_MAJOR, 0)
4-
define(_CLIENT_VERSION_MINOR, 13)
4+
define(_CLIENT_VERSION_MINOR, 14)
55
define(_CLIENT_VERSION_REVISION, 99)
66
define(_CLIENT_VERSION_BUILD, 0)
77
define(_CLIENT_VERSION_IS_RELEASE, false)
@@ -1087,7 +1087,7 @@ AC_SUBST(ZMQ_LIBS)
10871087
AC_SUBST(PROTOBUF_LIBS)
10881088
AC_SUBST(QR_LIBS)
10891089
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
1090-
AC_CONFIG_FILES([qa/pull-tester/tests_config.py],[chmod +x qa/pull-tester/tests_config.py])
1090+
AC_CONFIG_FILES([qa/pull-tester/tests_config.ini],[chmod +x qa/pull-tester/tests_config.ini])
10911091
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
10921092
AC_CONFIG_LINKS([qa/pull-tester/rpc-tests.py:qa/pull-tester/rpc-tests.py])
10931093

contrib/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Repository Tools
33

44
### [Developer tools](/contrib/devtools) ###
55
Specific tools for developers working on this repository.
6-
Contains the script `github-merge.py` for merging github pull requests securely and signing them using GPG.
6+
Contains the script `github-merge.py` for merging GitHub pull requests securely and signing them using GPG.
77

88
### [Verify-Commits](/contrib/verify-commits) ###
99
Tool to verify that every merge commit was signed by a developer using the above `github-merge.py` script.

contrib/devtools/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ check or whatever).
125125

126126
This means that there are no potential race conditions (where a
127127
pullreq gets updated while you're reviewing it, but before you click
128-
merge), and when using GPG signatures, that even a compromised github
128+
merge), and when using GPG signatures, that even a compromised GitHub
129129
couldn't mess with the sources.
130130

131131
Setup

contrib/devtools/update-translations.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ def split_format_specifiers(specifiers):
6565
else:
6666
other.append(s)
6767

68+
# If both numeric format specifiers and "others" are used, assume we're dealing
69+
# with a Qt-formatted message. In the case of Qt formatting (see https://doc.qt.io/qt-5/qstring.html#arg)
70+
# only numeric formats are replaced at all. This means "(percentage: %1%)" is valid, without needing
71+
# any kind of escaping that would be necessary for strprintf. Without this, this function
72+
# would wrongly detect '%)' as a printf format specifier.
73+
if numeric:
74+
other = []
75+
6876
# numeric (Qt) can be present in any order, others (strprintf) must be in specified order
6977
return set(numeric),other
7078

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: "bitcoin-linux-0.13"
2+
name: "bitcoin-linux-0.15"
33
enable_cache: true
44
suites:
55
- "trusty"

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: "bitcoin-osx-0.13"
2+
name: "bitcoin-osx-0.15"
33
enable_cache: true
44
suites:
55
- "trusty"

contrib/gitian-descriptors/gitian-win.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: "bitcoin-win-0.13"
2+
name: "bitcoin-win-0.15"
33
enable_cache: true
44
suites:
55
- "trusty"

contrib/zmq/zmq_sub.py

Lines changed: 69 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,84 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python3
22
# Copyright (c) 2014-2016 The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

6+
"""
7+
ZMQ example using python3's asyncio
8+
9+
Bitcoin should be started with the command line arguments:
10+
bitcoind -testnet -daemon \
11+
-zmqpubhashblock=tcp://127.0.0.1:28332 \
12+
-zmqpubrawtx=tcp://127.0.0.1:28332 \
13+
-zmqpubhashtx=tcp://127.0.0.1:28332 \
14+
-zmqpubhashblock=tcp://127.0.0.1:28332
15+
16+
We use the asyncio library here. `self.handle()` installs itself as a
17+
future at the end of the function. Since it never returns with the event
18+
loop having an empty stack of futures, this creates an infinite loop. An
19+
alternative is to wrap the contents of `handle` inside `while True`.
20+
21+
A blocking example using python 2.7 can be obtained from the git history:
22+
https://github.com/bitcoin/bitcoin/blob/37a7fe9e440b83e2364d5498931253937abe9294/contrib/zmq/zmq_sub.py
23+
"""
24+
625
import binascii
26+
import asyncio
727
import zmq
28+
import zmq.asyncio
29+
import signal
830
import struct
31+
import sys
32+
33+
if not (sys.version_info.major >= 3 and sys.version_info.minor >= 5):
34+
print("This example only works with Python 3.5 and greater")
35+
exit(1)
936

1037
port = 28332
1138

12-
zmqContext = zmq.Context()
13-
zmqSubSocket = zmqContext.socket(zmq.SUB)
14-
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "hashblock")
15-
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "hashtx")
16-
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "rawblock")
17-
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "rawtx")
18-
zmqSubSocket.connect("tcp://127.0.0.1:%i" % port)
19-
20-
try:
21-
while True:
22-
msg = zmqSubSocket.recv_multipart()
23-
topic = str(msg[0])
39+
class ZMQHandler():
40+
def __init__(self):
41+
self.loop = zmq.asyncio.install()
42+
self.zmqContext = zmq.asyncio.Context()
43+
44+
self.zmqSubSocket = self.zmqContext.socket(zmq.SUB)
45+
self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, "hashblock")
46+
self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, "hashtx")
47+
self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, "rawblock")
48+
self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, "rawtx")
49+
self.zmqSubSocket.connect("tcp://127.0.0.1:%i" % port)
50+
51+
async def handle(self) :
52+
msg = await self.zmqSubSocket.recv_multipart()
53+
topic = msg[0]
2454
body = msg[1]
2555
sequence = "Unknown"
2656
if len(msg[-1]) == 4:
2757
msgSequence = struct.unpack('<I', msg[-1])[-1]
2858
sequence = str(msgSequence)
29-
if topic == "hashblock":
30-
print '- HASH BLOCK ('+sequence+') -'
31-
print binascii.hexlify(body)
32-
elif topic == "hashtx":
33-
print '- HASH TX ('+sequence+') -'
34-
print binascii.hexlify(body)
35-
elif topic == "rawblock":
36-
print '- RAW BLOCK HEADER ('+sequence+') -'
37-
print binascii.hexlify(body[:80])
38-
elif topic == "rawtx":
39-
print '- RAW TX ('+sequence+') -'
40-
print binascii.hexlify(body)
41-
42-
except KeyboardInterrupt:
43-
zmqContext.destroy()
59+
if topic == b"hashblock":
60+
print('- HASH BLOCK ('+sequence+') -')
61+
print(binascii.hexlify(body))
62+
elif topic == b"hashtx":
63+
print('- HASH TX ('+sequence+') -')
64+
print(binascii.hexlify(body))
65+
elif topic == b"rawblock":
66+
print('- RAW BLOCK HEADER ('+sequence+') -')
67+
print(binascii.hexlify(body[:80]))
68+
elif topic == b"rawtx":
69+
print('- RAW TX ('+sequence+') -')
70+
print(binascii.hexlify(body))
71+
# schedule ourselves to receive the next message
72+
asyncio.ensure_future(self.handle())
73+
74+
def start(self):
75+
self.loop.add_signal_handler(signal.SIGINT, self.stop)
76+
self.loop.create_task(self.handle())
77+
self.loop.run_forever()
78+
79+
def stop(self):
80+
self.loop.stop()
81+
self.zmqContext.destroy()
82+
83+
daemon = ZMQHandler()
84+
daemon.start()

0 commit comments

Comments
 (0)