Skip to content

Commit

Permalink
Follow Bitcoin PRs:
Browse files Browse the repository at this point in the history
- doc: fix git add argument bitcoin#18513
- build: Fix libevent linking for bench_bitcoin binary bitcoin#18397
- script: fix SCRIPT_ERR_SIG_PUSHONLY error string bitcoin#18412
- doc: Comment fix merkle.cpp bitcoin#18379
- log: Fix UB with bench on genesis block bitcoin#15283
- test: Fix mining to an invalid target + ensure that a new block has the correct hash internally bitcoin#18350
- Fix missing header in sync.h bitcoin#18357
- refactor: Fix implicit value conversion in formatPingTime bitcoin#18260
- Fix .gitignore policy in build_msvc directory bitcoin#18108
- build: Fix behavior when ALLOW_HOST_PACKAGES unset bitcoin#18051
- test: Fix p2p_invalid_messages failing in Python 3.8 because of warning bitcoin#17931
- qa: Fix double-negative arg test bitcoin#17893
- build: Fix configure report about qr bitcoin#17547
- log: Fix log message for -par=1 bitcoin#17325
- bench: Fix negative values and zero for -evals flag bitcoin#17267
- depends: fix boost mac cross build with clang 9+ bitcoin#17231
- doc: Fix broken bitcoin-cli examples bitcoin#17119
- doc: fix Makefile target in benchmarking.md bitcoin#17081
- contrib: fix minor typos in makeseeds.py bitcoin#17042
- test: Fix Python Docstring to include all Args. bitcoin#17030
- doc: Fix some misspellings bitcoin#17351
- doc: Doxygen-friendly script/descriptor.h comments bitcoin#16947
- doc: Fix doxygen errors bitcoin#17945
- doc: Doxygen-friendly CuckooCache comments bitcoin#16986
- doc: Add to Doxygen documentation guidelines bitcoin#17873
  • Loading branch information
MarkLTZ committed Apr 7, 2020
1 parent 8436547 commit 8823f65
Show file tree
Hide file tree
Showing 46 changed files with 252 additions and 191 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ src/qt/litecoinz-qt.includes
*.qm
Makefile
!depends/Makefile
litecoinz-qt
src/qt/litecoinz-qt
Litecoinz-Qt.app
background.tiff*

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ with no central authority: managing transactions and issuing money are carried
out collectively by the network. LitecoinZ Core is the name of open source
software which enables the use of this currency.

For more information, as well as an immediately useable, binary version of
For more information, as well as an immediately usable, binary version of
the LitecoinZ Core software, see https://litecoinz.org/download/, or read the
[original whitepaper](https://litecoinz.org/litecoinz.pdf).

Expand Down
14 changes: 13 additions & 1 deletion build_msvc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ packages/*
*/Release
*/x64
*.vcxproj.user
*.vcxproj

# .vcxproj files that are auto-generated by the msvc-autogen.py script.
libbitcoin_cli/libbitcoin_cli.vcxproj
libbitcoin_common/libbitcoin_common.vcxproj
libbitcoin_crypto/libbitcoin_crypto.vcxproj
libbitcoin_server/libbitcoin_server.vcxproj
libbitcoin_util/libbitcoin_util.vcxproj
libbitcoin_wallet_tool/libbitcoin_wallet_tool.vcxproj
libbitcoin_wallet/libbitcoin_wallet.vcxproj
libbitcoin_zmq/libbitcoin_zmq.vcxproj
bench_bitcoin/bench_bitcoin.vcxproj
libtest_util/libtest_util.vcxproj

*/Win32
libbitcoin_qt/QtGeneratedFiles/*
test_litecoinz-qt/QtGeneratedFiles/*
12 changes: 5 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ if test x$use_pkgconfig = xyes; then
if test x$use_qr != xno; then
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
fi
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then
PKG_CHECK_MODULES([EVENT], [libevent],, [AC_MSG_ERROR(libevent not found.)])
if test x$TARGET_OS != xwindows; then
PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads],, [AC_MSG_ERROR(libevent_pthreads not found.)])
Expand All @@ -1289,7 +1289,7 @@ else
AC_CHECK_HEADER([sodium.h],,AC_MSG_ERROR(libsodium headers missing))
AC_CHECK_LIB([sodium],[sodium_init],SODIUM_LIBS=-lsodium,AC_MSG_ERROR(libsodium missing))

if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then
AC_CHECK_HEADER([event2/event.h],, AC_MSG_ERROR(libevent headers missing),)
AC_CHECK_LIB([event],[main],EVENT_LIBS=-levent,AC_MSG_ERROR(libevent missing))
if test x$TARGET_OS != xwindows; then
Expand Down Expand Up @@ -1487,18 +1487,16 @@ if test x$bitcoin_enable_qt != xno; then
AC_MSG_CHECKING([whether to build GUI with support for QR codes])
if test x$have_qrencode = xno; then
if test x$use_qr = xyes; then
AC_MSG_ERROR("QR support requested but cannot be built. use --without-qrencode")
AC_MSG_ERROR([QR support requested but cannot be built. Use --without-qrencode])
fi
AC_MSG_RESULT(no)
use_qr=no
else
if test x$use_qr != xno; then
AC_MSG_RESULT(yes)
AC_DEFINE([USE_QRCODE],[1],[Define if QR support should be compiled in])
use_qr=yes
else
AC_MSG_RESULT(no)
fi
fi
AC_MSG_RESULT([$use_qr])

if test x$XGETTEXT = x; then
AC_MSG_WARN("xgettext is required to update qt translations")
Expand Down
2 changes: 1 addition & 1 deletion contrib/guix/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ chain for " target " development."))
(base-kernel-headers linux-libre-headers-4.19)
(base-libc glibc-2.27)
(base-gcc (make-gcc-rpath-link gcc-9)))
"Convienience wrapper around MAKE-CROSS-TOOLCHAIN with default values
"Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values
desirable for building LitecoinZ Core release binaries."
(make-cross-toolchain target
base-gcc-for-libc
Expand Down
4 changes: 2 additions & 2 deletions contrib/seeds/makeseeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def filtermultiport(ips):

def lookup_asn(net, ip):
'''
Look up the asn for an IP (4 or 6) address by querying cymry.com, or None
Look up the asn for an IP (4 or 6) address by querying cymru.com, or None
if it could not be found.
'''
try:
Expand Down Expand Up @@ -187,7 +187,7 @@ def main():
# Skip entries with invalid address.
ips = [ip for ip in ips if ip is not None]
print('%s Skip entries with invalid address' % (ip_stats(ips)), file=sys.stderr)
# Skip duplicattes (in case multiple seeds files were concatenated)
# Skip duplicates (in case multiple seeds files were concatenated)
ips = dedup(ips)
print('%s After removing duplicates' % (ip_stats(ips)), file=sys.stderr)
# Skip entries from suspicious hosts.
Expand Down
2 changes: 1 addition & 1 deletion depends/config.site.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ PKG_CONFIG="`which pkg-config` --static"
# avoid ruining the cache. Sigh.
export PKG_CONFIG_PATH=$depends_prefix/share/pkgconfig:$depends_prefix/lib/pkgconfig
if test -z "@allow_host_packages@"; then
export PKGCONFIG_LIBDIR=
export PKG_CONFIG_LIBDIR=$depends_prefix/lib/pkgconfig
fi

CPPFLAGS="-I$depends_prefix/include/ $CPPFLAGS"
Expand Down
5 changes: 2 additions & 3 deletions depends/packages/boost.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ $(package)_config_opts_debug=variant=debug
$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
$(package)_config_opts_linux=threadapi=pthread runtime-link=shared
$(package)_config_opts_darwin=--toolset=darwin-4.2.1 runtime-link=shared
$(package)_config_opts_darwin=--toolset=clang-darwin runtime-link=shared
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
$(package)_config_opts_x86_64_mingw32=address-model=64
$(package)_config_opts_i686_mingw32=address-model=32
$(package)_config_opts_i686_linux=address-model=32 architecture=x86
$(package)_toolset_$(host_os)=gcc
$(package)_archiver_$(host_os)=$($(package)_ar)
$(package)_toolset_darwin=darwin
$(package)_archiver_darwin=$($(package)_libtool)
$(package)_toolset_darwin=clang-darwin
$(package)_config_libraries=chrono,filesystem,system,thread,test
$(package)_cxxflags=-std=c++11 -fvisibility=hidden
$(package)_cxxflags_linux=-fPIC
Expand Down
2 changes: 1 addition & 1 deletion doc/benchmarking.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Running
For benchmarks purposes you only need to compile `litecoinz_bench`. Beware of configuring without `--enable-debug` as this would impact
benchmarking by unlatching log printers and lock analysis.

make -C src bench_litecoinz
make -C src litecoinz_bench

After compiling litecoinz-core, the benchmarks can be run with:

Expand Down
73 changes: 55 additions & 18 deletions doc/developer-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Developer Notes
- [Coding Style (C++)](#coding-style-c)
- [Coding Style (Python)](#coding-style-python)
- [Coding Style (Doxygen-compatible comments)](#coding-style-doxygen-compatible-comments)
- [Generating Documentation](#generating-documentation)
- [Development tips and tricks](#development-tips-and-tricks)
- [Compiling for debugging](#compiling-for-debugging)
- [Compiling for gprof profiling](#compiling-for-gprof-profiling)
Expand All @@ -34,6 +35,9 @@ Developer Notes
- [Source code organization](#source-code-organization)
- [GUI](#gui)
- [Subtrees](#subtrees)
- [Upgrading LevelDB](#upgrading-leveldb)
- [File Descriptor Counts](#file-descriptor-counts)
- [Consensus Compatibility](#consensus-compatibility)
- [Scripted diffs](#scripted-diffs)
- [Release notes](#release-notes)
- [RPC interface guidelines](#rpc-interface-guidelines)
Expand Down Expand Up @@ -136,13 +140,17 @@ Use Doxygen-compatible comment blocks for functions, methods, and fields.
For example, to describe a function use:

```c++
/**
* ... text ...
* @param[in] arg1 A description
* @param[in] arg2 Another argument description
* @pre Precondition for function...
* ... Description ...
*
* @param[in] arg1 input description...
* @param[in] arg2 input description...
* @param[out] arg3 output description...
* @return Return cases...
* @throws Error type and cases...
* @pre Pre-condition for function...
* @post Post-condition for function...
*/
bool function(int arg1, const char *arg2)
bool function(int arg1, const char *arg2, std::string& arg3)
```
A complete list of `@xxx` commands can be found at http://www.doxygen.nl/manual/commands.html.
Expand All @@ -157,44 +165,73 @@ To describe a class, use the same construct above the class definition:
* @see GetWarnings()
*/
class CAlert
{
```

To describe a member or variable use:
```c++
int var; //!< Detailed description after the member
//! Description before the member
int var;
```

or
```c++
//! Description before the member
int var;
int var; //!< Description after the member
```

Also OK:
```c++
///
/// ... text ...
/// ... Description ...
///
bool function2(int arg1, const char *arg2)
```
Not OK (used plenty in the current source, but not picked up):
Not picked up by Doxygen:
```c++
//
// ... text ...
// ... Description ...
//
```

Also not picked up by Doxygen:
```c++
/*
* ... Description ...
*/
```

A full list of comment syntaxes picked up by Doxygen can be found at http://www.doxygen.nl/manual/docblocks.html,
but the above styles are favored.

Documentation can be generated with `make docs` and cleaned up with `make clean-docs`. The resulting files are located in `doc/doxygen/html`; open `index.html` to view the homepage.
Recommendations:

Before running `make docs`, you will need to install dependencies `doxygen` and `dot`. For example, on macOS via Homebrew:
```
brew install graphviz doxygen
```
- Avoiding duplicating type and input/output information in function
descriptions.

- Use backticks (&#96;&#96;) to refer to `argument` names in function and
parameter descriptions.

- Backticks aren't required when referring to functions Doxygen already knows
about; it will build hyperlinks for these automatically. See
http://www.doxygen.nl/manual/autolink.html for complete info.

- Avoid linking to external documentation; links can break.

- Javadoc and all valid Doxygen comments are stripped from Doxygen source code
previews (`STRIP_CODE_COMMENTS = YES` in [Doxyfile.in](doc/Doxyfile.in)). If
you want a comment to be preserved, it must instead use `//` or `/* */`.

### Generating Documentation

The documentation can be generated with `make docs` and cleaned up with `make
clean-docs`. The resulting files are located in `doc/doxygen/html`; open
`index.html` in that directory to view the homepage.

Before running `make docs`, you'll need to install these dependencies:

Linux: `sudo apt install doxygen graphviz`

MacOS: `brew install doxygen graphviz`

Development tips and tricks
---------------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Codesigner only: Commit the detached codesign payloads:
rm -rf *
tar xf signature-osx.tar.gz
tar xf signature-win.tar.gz
git add -a
git add -A
git commit -m "point to ${VERSION}"
git tag -s v${VERSION} HEAD
git push the current branch and new tag
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.bench.include
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ bench_bench_litecoinz_SOURCES = \

nodist_bench_bench_litecoinz_SOURCES = $(GENERATED_BENCH_FILES)

bench_bench_litecoinz_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CLFAGS) $(EVENT_PTHREADS_CFLAGS) -I$(builddir)/bench/
bench_bench_litecoinz_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS) -I$(builddir)/bench/
bench_bench_litecoinz_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
bench_bench_litecoinz_LDADD = \
$(LIBBITCOIN_SERVER) \
Expand Down
7 changes: 7 additions & 0 deletions src/bench/bench_bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ int main(int argc, char** argv)
std::string scaling_str = gArgs.GetArg("-scaling", DEFAULT_BENCH_SCALING);
bool is_list_only = gArgs.GetBoolArg("-list", false);

if (evaluations == 0) {
return EXIT_SUCCESS;
} else if (evaluations < 0) {
tfm::format(std::cerr, "Error parsing evaluations argument: %d\n", evaluations);
return EXIT_FAILURE;
}

double scaling_factor;
if (!ParseDouble(scaling_str, &scaling_factor)) {
tfm::format(std::cerr, "Error parsing scaling factor as double: %s\n", scaling_str.c_str());
Expand Down
2 changes: 1 addition & 1 deletion src/consensus/merkle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
that the following merkle tree algorithm has a serious flaw related to
duplicate txids, resulting in a vulnerability (CVE-2012-2459).
The reason is that if the number of hashes in the list at a given time
The reason is that if the number of hashes in the list at a given level
is odd, the last one is duplicated before computing the next level (which
is unusual in Merkle trees). This results in certain sequences of
transactions leading to the same merkle root. For example, these two
Expand Down
Loading

0 comments on commit 8823f65

Please sign in to comment.