From 611088eec784bfb6f3dc97fb2ca4abd40b95ac73 Mon Sep 17 00:00:00 2001 From: jamescowens Date: Tue, 16 Mar 2021 18:34:25 -0400 Subject: [PATCH 1/4] Fix another subtle error in renewal chain walker In GetNewbieSuperblockAccrualCorrection the while loop that walks the beacon chain backwards to the original advertisement has a mistake and uses beacon instead of beacon_ptr in the find. As a result it will not work for more than one renewal cycle. This is not a consensus issue, because this function is not called for beacons that have more than one renewal cycle. In fact, now that the newbie bug is out of the way, it will not be called for beacons with any renewal at all. So this is merely for correctness. --- src/gridcoin/tally.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gridcoin/tally.cpp b/src/gridcoin/tally.cpp index 21f825be3d..0e69795251 100644 --- a/src/gridcoin/tally.cpp +++ b/src/gridcoin/tally.cpp @@ -1055,7 +1055,7 @@ CAmount Tally::GetNewbieSuperblockAccrualCorrection(const Cpid& cpid, const Supe // than here. while (beacon_ptr->Renewed()) { - beacon_ptr = std::make_shared(beacons.GetBeaconDB().find(beacon->m_prev_beacon_hash)->second); + beacon_ptr = std::make_shared(beacons.GetBeaconDB().find(beacon_ptr->m_prev_beacon_hash)->second); } const CBlockIndex* pindex_baseline = GRC::Tally::GetBaseline(); From 7a3774fe84094ba051503ed2940d0980953956f5 Mon Sep 17 00:00:00 2001 From: jamescowens Date: Sun, 28 Mar 2021 11:58:31 -0400 Subject: [PATCH 2/4] Patch libzip to fix mingw compile regression for mingw 9.2+ --- depends/packages/libzip.mk | 5 +++-- depends/patches/libzip/compat.h.patch | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 depends/patches/libzip/compat.h.patch diff --git a/depends/packages/libzip.mk b/depends/packages/libzip.mk index a35ace1274..11ffdd414b 100644 --- a/depends/packages/libzip.mk +++ b/depends/packages/libzip.mk @@ -4,7 +4,7 @@ $(package)_download_path=https://libzip.org/download/ $(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_sha256_hash=ab4c34eb6c3a08b678cd0f2450a6c57a13e9618b1ba34ee45d00eb5327316457 $(package)_dependencies=zlib bzip2 -$(package)_patches=nonrandomopentest.c.patch +$(package)_patches=nonrandomopentest.c.patch compat.h.patch define $(package)_set_vars @@ -27,7 +27,8 @@ endif define $(package)_preprocess_cmds sed -i.old 's/\# ifdef _WIN32/\# if defined _WIN32 \&\& defined ZIP_DLL/' lib/zip.h && \ - patch -p1 < $($(package)_patch_dir)/nonrandomopentest.c.patch + patch -p1 < $($(package)_patch_dir)/nonrandomopentest.c.patch && \ + patch -p1 < $($(package)_patch_dir)/compat.h.patch endef define $(package)_config_cmds diff --git a/depends/patches/libzip/compat.h.patch b/depends/patches/libzip/compat.h.patch new file mode 100644 index 0000000000..cba2486369 --- /dev/null +++ b/depends/patches/libzip/compat.h.patch @@ -0,0 +1,15 @@ +--- old/lib/compat.h 2017-10-06 07:00:00.000000000 -0400 ++++ new/lib/compat.h 2021-03-28 00:19:50.891360075 -0400 +@@ -92,9 +92,9 @@ + #if defined(HAVE__OPEN) + #define open(a, b, c) _open((a), (b)) + #endif +-#if defined(HAVE__SNPRINTF) +-#define snprintf _snprintf +-#endif ++//#if defined(HAVE__SNPRINTF) ++//#define snprintf _snprintf ++//#endif + #if defined(HAVE__STRDUP) + #if !defined(HAVE_STRDUP) || defined(_WIN32) + #undef strdup From f4e4be863a5fb58a8ff651ee7cce415dca5cbb9d Mon Sep 17 00:00:00 2001 From: div72 <60045611+div72@users.noreply.github.com> Date: Tue, 8 Mar 2022 17:30:33 +0300 Subject: [PATCH 3/4] build: change bundle id --- share/qt/Info.plist.in | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/share/qt/Info.plist.in b/share/qt/Info.plist.in index 6966d34e5d..4043499b1f 100644 --- a/share/qt/Info.plist.in +++ b/share/qt/Info.plist.in @@ -38,7 +38,7 @@ CFBundleIdentifier - org.bitcoinfoundation.Bitcoin-Qt + world.gridcoin.Gridcoin-Qt CFBundleURLTypes @@ -46,10 +46,10 @@ CFBundleTypeRole Editor CFBundleURLName - org.bitcoin.BitcoinPayment + world.gridcoin.GridcoinPayment CFBundleURLSchemes - bitcoin + gridcoin @@ -58,9 +58,9 @@ UTTypeIdentifier - org.bitcoin.paymentrequest + world.gridcoin.paymentrequest UTTypeDescription - Bitcoin payment request + Gridcoin payment request UTTypeConformsTo public.data @@ -68,10 +68,10 @@ UTTypeTagSpecification public.mime-type - application/x-bitcoin-payment-request + application/x-gridcoin-payment-request public.filename-extension - bitcoinpaymentrequest + gridcoinpaymentrequest @@ -84,7 +84,7 @@ Editor LSItemContentTypes - org.bitcoin.paymentrequest + world.gridcoin.paymentrequest LSHandlerRank Owner From bd6e11154df1e1c5ac091b6a92f075002128273c Mon Sep 17 00:00:00 2001 From: div72 <60045611+div72@users.noreply.github.com> Date: Mon, 27 Mar 2023 01:27:11 +0300 Subject: [PATCH 4/4] build: use builddir instead of srcdir for bdb 5.3 include Rationale: BDB 5.3 generates the headers to include in the build directory. For most cases, this will not matter as most builds are done in tree where source directory and build directory are the same. However since CD builds are done out of tree, using srcdir leads to an issue where the include files are generated in the build directory while automake expects them to be in the source directory. Normally this would also be a problem with the CI, however since CI does an in-tree configure first (ci/test/06_script_a.sh#L24) the needed include files are also generated in source which leads to the build system finding them. --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index dc96ba08fd..c2e0592520 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,7 +23,7 @@ LIBUNIVALUE = $(UNIVALUE_LIBS) endif GRIDCOIN_CONFIG_INCLUDES=-I$(builddir)/config -GRIDCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -I$(srcdir)/bdb53 $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) $(UNIVALUE_CFLAGS) $(CURL_CFLAGS) $(LIBZIP_CFLAGS) +GRIDCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -I$(builddir)/bdb53 $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) $(UNIVALUE_CFLAGS) $(CURL_CFLAGS) $(LIBZIP_CFLAGS) LIBGRIDCOIN_UTIL=libgridcoin_util.a LIBGRIDCOINQT=qt/libgridcoinqt.a