diff options
author | Musee Ullah | 2017-08-01 19:34:13 -0700 |
---|---|---|
committer | Musee Ullah | 2017-08-01 19:34:13 -0700 |
commit | 82e35ff928f2863bf7d12335c7e3cbffc02608a2 (patch) | |
tree | 0b2a3c066db9d045fc3ebf111568db1a61700bfc | |
parent | cfdb2e07d609295758fa08eb14bdba0a730dd464 (diff) | |
download | aur-82e35ff928f2863bf7d12335c7e3cbffc02608a2.tar.gz |
Update for 0.14.2 release
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | 0001-rename-libbitcoinconsensus-to-libmonacoinconsensus.patch | 457 | ||||
-rw-r--r-- | PKGBUILD | 6 |
3 files changed, 366 insertions, 105 deletions
@@ -1,6 +1,6 @@ pkgbase = monacoin-qt pkgdesc = peer-to-peer network based digital currency - Qt GUI - pkgver = 0.13.2.2 + pkgver = 0.14.2 pkgrel = 1 url = https://monacoin.org/en/index.html install = monacoin.install @@ -26,11 +26,11 @@ pkgbase = monacoin-qt provides = monacoin-qt provides = monacoind provides = monacoin-tx - source = https://github.com/monacoinproject/monacoin/archive/monacoin-0.13.2.2.tar.gz + source = https://github.com/monacoinproject/monacoin/archive/monacoin-0.14.2.tar.gz source = 0001-rename-libbitcoinconsensus-to-libmonacoinconsensus.patch source = monacoin-qt.desktop - sha256sums = 4ae8b22dd3fcf3c805ea5518df89164da6e8631acbc4c7c456516dc46711e877 - sha256sums = cc40072b3c614d8e07dabd68af1ae66304e2b4527f5338c6139d3e081c9dc17f + sha256sums = 03eac8256932150dfa2f399931530545f90ff8d03b4559f03e40836cfbf7be02 + sha256sums = bdb0f7efd41b02cb0407b194a2f8cb28d3c82f6ec7bbaf26e1144bf302e7f7d4 sha256sums = 4af25bac0076c6d2060832b66819741d3e049a71d6ad5f1a26a2700415d23cfc pkgname = monacoin-qt diff --git a/0001-rename-libbitcoinconsensus-to-libmonacoinconsensus.patch b/0001-rename-libbitcoinconsensus-to-libmonacoinconsensus.patch index 9bed61a0d6c3..d7fccf34cd36 100644 --- a/0001-rename-libbitcoinconsensus-to-libmonacoinconsensus.patch +++ b/0001-rename-libbitcoinconsensus-to-libmonacoinconsensus.patch @@ -1,27 +1,34 @@ -From 2f946226275023c175da9b17b93c1f2db8d4a848 Mon Sep 17 00:00:00 2001 +From 195c3fc052d8c94377d584123fa1961ba2255afe Mon Sep 17 00:00:00 2001 From: Musee Ullah <lae@lae.is> -Date: Thu, 22 Jun 2017 06:26:58 -0700 +Date: Tue, 1 Aug 2017 19:10:45 -0700 Subject: [PATCH] rename libbitcoinconsensus to libmonacoinconsensus --- .gitignore | 2 +- Makefile.am | 2 +- configure.ac | 2 +- - ...inconsensus.pc.in => libmonacoinconsensus.pc.in | 4 +-- - src/Makefile.am | 28 +++++++-------- - ...{bitcoinconsensus.cpp => monacoinconsensus.cpp} | 30 ++++++++-------- - .../{bitcoinconsensus.h => monacoinconsensus.h} | 40 +++++++++++----------- - src/test/script_tests.cpp | 10 +++--- - 8 files changed, 59 insertions(+), 59 deletions(-) + ...inconsensus.pc.in => libmonacoinconsensus.pc.in | 4 +- + src/Makefile.am | 36 +++++----- + src/Makefile.bench.include | 2 +- + src/Makefile.qt.include | 4 +- + src/Makefile.qttest.include | 2 +- + src/Makefile.test.include | 6 +- + src/bench/verify_script.cpp | 4 +- + src/script/bitcoinconsensus.h | 83 ---------------------- + ...{bitcoinconsensus.cpp => monacoinconsensus.cpp} | 34 ++++----- + src/script/monacoinconsensus.h | 83 ++++++++++++++++++++++ + src/test/script_tests.cpp | 12 ++-- + 14 files changed, 138 insertions(+), 138 deletions(-) rename libbitcoinconsensus.pc.in => libmonacoinconsensus.pc.in (67%) - rename src/script/{bitcoinconsensus.cpp => monacoinconsensus.cpp} (76%) - rename src/script/{bitcoinconsensus.h => monacoinconsensus.h} (54%) + delete mode 100644 src/script/bitcoinconsensus.h + rename src/script/{bitcoinconsensus.cpp => monacoinconsensus.cpp} (75%) + create mode 100644 src/script/monacoinconsensus.h diff --git a/.gitignore b/.gitignore -index 6dcf89aed..530da5afc 100644 +index 6a57bd3..dcfd49c 100644 --- a/.gitignore +++ b/.gitignore -@@ -113,5 +113,5 @@ share/BitcoindComparisonTool.jar +@@ -108,5 +108,5 @@ qa/cache/* /doc/doxygen/ @@ -29,10 +36,10 @@ index 6dcf89aed..530da5afc 100644 +libmonacoinconsensus.pc contrib/devtools/split-debug.sh diff --git a/Makefile.am b/Makefile.am -index bacf36b90..639aea4b8 100644 +index f372f7d..595ecdc 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -11,7 +11,7 @@ export PYTHONPATH +@@ -14,7 +14,7 @@ export PYTHONPATH if BUILD_BITCOIN_LIBS pkgconfigdir = $(libdir)/pkgconfig @@ -42,10 +49,10 @@ index bacf36b90..639aea4b8 100644 BITCOIND_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT) diff --git a/configure.ac b/configure.ac -index 7398c4bda..51d3ae5a6 100644 +index 26ed039..1dd296f 100644 --- a/configure.ac +++ b/configure.ac -@@ -905,7 +905,7 @@ AC_MSG_CHECKING([whether to build libraries]) +@@ -930,7 +930,7 @@ AC_MSG_CHECKING([whether to build libraries]) AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes]) if test x$build_bitcoin_libs = xyes; then AC_DEFINE(HAVE_CONSENSUS_LIB, 1, [Define this symbol if the consensus lib has been built]) @@ -58,7 +65,7 @@ diff --git a/libbitcoinconsensus.pc.in b/libmonacoinconsensus.pc.in similarity index 67% rename from libbitcoinconsensus.pc.in rename to libmonacoinconsensus.pc.in -index eb920c47e..47960d29c 100644 +index eb920c4..47960d2 100644 --- a/libbitcoinconsensus.pc.in +++ b/libmonacoinconsensus.pc.in @@ -4,8 +4,8 @@ libdir=@libdir@ @@ -73,7 +80,7 @@ index eb920c47e..47960d29c 100644 Cflags: -I${includedir} Requires.private: libcrypto diff --git a/src/Makefile.am b/src/Makefile.am -index c731c8c56..14f6e492f 100644 +index 3850915..e1e19a6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,7 +26,7 @@ BITCOIN_INCLUDES += $(UNIVALUE_CFLAGS) @@ -81,7 +88,7 @@ index c731c8c56..14f6e492f 100644 LIBBITCOIN_SERVER=libbitcoin_server.a LIBBITCOIN_COMMON=libbitcoin_common.a -LIBBITCOIN_CONSENSUS=libbitcoin_consensus.a -+LIBBITCOIN_CONSENSUS=libmonacoin_consensus.a ++LIBMONACOIN_CONSENSUS=libmonacoin_consensus.a LIBBITCOIN_CLI=libbitcoin_cli.a LIBBITCOIN_UTIL=libbitcoin_util.a LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a @@ -90,24 +97,40 @@ index c731c8c56..14f6e492f 100644 endif if BUILD_BITCOIN_LIBS -LIBBITCOINCONSENSUS=libbitcoinconsensus.la -+LIBBITCOINCONSENSUS=libmonacoinconsensus.la ++LIBMONACOINCONSENSUS=libmonacoinconsensus.la endif if ENABLE_WALLET LIBBITCOIN_WALLET=libbitcoin_wallet.a -@@ -250,9 +250,9 @@ crypto_libbitcoin_crypto_a_SOURCES = \ - crypto/sha512.h +@@ -52,13 +52,13 @@ EXTRA_LIBRARIES += \ + $(LIBBITCOIN_CRYPTO) \ + $(LIBBITCOIN_UTIL) \ + $(LIBBITCOIN_COMMON) \ +- $(LIBBITCOIN_CONSENSUS) \ ++ $(LIBMONACOIN_CONSENSUS) \ + $(LIBBITCOIN_SERVER) \ + $(LIBBITCOIN_CLI) \ + $(LIBBITCOIN_WALLET) \ + $(LIBBITCOIN_ZMQ) + +-lib_LTLIBRARIES = $(LIBBITCOINCONSENSUS) ++lib_LTLIBRARIES = $(LIBMONACOINCONSENSUS) + + bin_PROGRAMS = + noinst_PROGRAMS = +@@ -260,9 +260,9 @@ crypto_libbitcoin_crypto_a_SOURCES = \ + crypto/sha512.h # consensus: shared between all executables that validate any consensus rules. --libbitcoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -fPIC --libbitcoin_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -fPIC +-libbitcoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) +-libbitcoin_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -libbitcoin_consensus_a_SOURCES = \ -+libmonacoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -fPIC -+libmonacoin_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -fPIC ++libmonacoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) ++libmonacoin_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) +libmonacoin_consensus_a_SOURCES = \ amount.h \ arith_uint256.cpp \ arith_uint256.h \ -@@ -269,7 +269,7 @@ libbitcoin_consensus_a_SOURCES = \ +@@ -279,7 +279,7 @@ libbitcoin_consensus_a_SOURCES = \ primitives/transaction.h \ pubkey.cpp \ pubkey.h \ @@ -116,7 +139,24 @@ index c731c8c56..14f6e492f 100644 script/interpreter.cpp \ script/interpreter.h \ script/script.cpp \ -@@ -425,19 +425,19 @@ monacoin_tx_LDADD = \ +@@ -392,7 +392,7 @@ monacoind_LDADD = \ + $(LIBBITCOIN_UTIL) \ + $(LIBBITCOIN_WALLET) \ + $(LIBBITCOIN_ZMQ) \ +- $(LIBBITCOIN_CONSENSUS) \ ++ $(LIBMONACOIN_CONSENSUS) \ + $(LIBBITCOIN_CRYPTO) \ + $(LIBLEVELDB) \ + $(LIBMEMENV) \ +@@ -433,26 +433,26 @@ monacoin_tx_LDADD = \ + $(LIBUNIVALUE) \ + $(LIBBITCOIN_COMMON) \ + $(LIBBITCOIN_UTIL) \ +- $(LIBBITCOIN_CONSENSUS) \ ++ $(LIBMONACOIN_CONSENSUS) \ + $(LIBBITCOIN_CRYPTO) \ + $(LIBSECP256K1) + monacoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS) # @@ -144,11 +184,200 @@ index c731c8c56..14f6e492f 100644 endif # +diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include +index 28938d4..4e491c9 100644 +--- a/src/Makefile.bench.include ++++ b/src/Makefile.bench.include +@@ -35,7 +35,7 @@ bench_bench_monacoin_LDADD = \ + $(LIBBITCOIN_SERVER) \ + $(LIBBITCOIN_COMMON) \ + $(LIBBITCOIN_UTIL) \ +- $(LIBBITCOIN_CONSENSUS) \ ++ $(LIBMONACOIN_CONSENSUS) \ + $(LIBBITCOIN_CRYPTO) \ + $(LIBLEVELDB) \ + $(LIBMEMENV) \ +diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include +index 0445433..a53f7bf 100644 +--- a/src/Makefile.qt.include ++++ b/src/Makefile.qt.include +@@ -404,7 +404,7 @@ endif + if ENABLE_ZMQ + qt_monacoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) + endif +-qt_monacoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ ++qt_monacoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBMONACOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ + $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \ + $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) + qt_monacoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +@@ -415,7 +415,7 @@ QT_QM=$(QT_TS:.ts=.qm) + + SECONDARY: $(QT_QM) + +-$(srcdir)/qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_wallet_a_SOURCES) $(libbitcoin_common_a_SOURCES) $(libbitcoin_zmq_a_SOURCES) $(libbitcoin_consensus_a_SOURCES) $(libbitcoin_util_a_SOURCES) ++$(srcdir)/qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_wallet_a_SOURCES) $(libbitcoin_common_a_SOURCES) $(libbitcoin_zmq_a_SOURCES) $(libmonacoin_consensus_a_SOURCES) $(libbitcoin_util_a_SOURCES) + @test -n $(XGETTEXT) || echo "xgettext is required for updating translations" + $(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) PACKAGE_NAME="$(PACKAGE_NAME)" COPYRIGHT_HOLDERS="$(COPYRIGHT_HOLDERS)" COPYRIGHT_HOLDERS_SUBSTITUTION="$(COPYRIGHT_HOLDERS_SUBSTITUTION)" $(PYTHON) ../share/qt/extract_strings_qt.py $^ + +diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include +index 51f9193..c2024aa 100644 +--- a/src/Makefile.qttest.include ++++ b/src/Makefile.qttest.include +@@ -44,7 +44,7 @@ endif + if ENABLE_ZMQ + qt_test_test_monacoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) + endif +-qt_test_test_monacoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \ ++qt_test_test_monacoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBMONACOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \ + $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ + $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \ + $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) +diff --git a/src/Makefile.test.include b/src/Makefile.test.include +index 528e094..8e16a65 100644 +--- a/src/Makefile.test.include ++++ b/src/Makefile.test.include +@@ -147,14 +147,14 @@ endif + + test_test_monacoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) + test_test_monacoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_CFLAGS) +-test_test_monacoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ ++test_test_monacoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBMONACOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ + $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) + test_test_monacoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) + if ENABLE_WALLET + test_test_monacoin_LDADD += $(LIBBITCOIN_WALLET) + endif + +-test_test_monacoin_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) ++test_test_monacoin_LDADD += $(LIBMONACOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) + test_test_monacoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static + + if ENABLE_ZMQ +@@ -173,7 +173,7 @@ test_test_monacoin_fuzzy_LDADD = \ + $(LIBBITCOIN_SERVER) \ + $(LIBBITCOIN_COMMON) \ + $(LIBBITCOIN_UTIL) \ +- $(LIBBITCOIN_CONSENSUS) \ ++ $(LIBMONACOIN_CONSENSUS) \ + $(LIBBITCOIN_CRYPTO) \ + $(LIBSECP256K1) + +diff --git a/src/bench/verify_script.cpp b/src/bench/verify_script.cpp +index 23bbadc..d3076bf 100644 +--- a/src/bench/verify_script.cpp ++++ b/src/bench/verify_script.cpp +@@ -5,7 +5,7 @@ + #include "bench.h" + #include "key.h" + #if defined(HAVE_CONSENSUS_LIB) +-#include "script/bitcoinconsensus.h" ++#include "script/monacoinconsensus.h" + #endif + #include "script/script.h" + #include "script/sign.h" +@@ -89,7 +89,7 @@ static void VerifyScriptBench(benchmark::State& state) + #if defined(HAVE_CONSENSUS_LIB) + CDataStream stream(SER_NETWORK, PROTOCOL_VERSION); + stream << txSpend; +- int csuccess = bitcoinconsensus_verify_script_with_amount( ++ int csuccess = monacoinconsensus_verify_script_with_amount( + txCredit.vout[0].scriptPubKey.data(), + txCredit.vout[0].scriptPubKey.size(), + txCredit.vout[0].nValue, +diff --git a/src/script/bitcoinconsensus.h b/src/script/bitcoinconsensus.h +deleted file mode 100644 +index 1bef4fe..0000000 +--- a/src/script/bitcoinconsensus.h ++++ /dev/null +@@ -1,83 +0,0 @@ +-// Copyright (c) 2009-2010 Satoshi Nakamoto +-// Copyright (c) 2009-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. +- +-#ifndef BITCOIN_BITCOINCONSENSUS_H +-#define BITCOIN_BITCOINCONSENSUS_H +- +-#include <stdint.h> +- +-#if defined(BUILD_BITCOIN_INTERNAL) && defined(HAVE_CONFIG_H) +-#include "config/bitcoin-config.h" +- #if defined(_WIN32) +- #if defined(DLL_EXPORT) +- #if defined(HAVE_FUNC_ATTRIBUTE_DLLEXPORT) +- #define EXPORT_SYMBOL __declspec(dllexport) +- #else +- #define EXPORT_SYMBOL +- #endif +- #endif +- #elif defined(HAVE_FUNC_ATTRIBUTE_VISIBILITY) +- #define EXPORT_SYMBOL __attribute__ ((visibility ("default"))) +- #endif +-#elif defined(MSC_VER) && !defined(STATIC_LIBBITCOINCONSENSUS) +- #define EXPORT_SYMBOL __declspec(dllimport) +-#endif +- +-#ifndef EXPORT_SYMBOL +- #define EXPORT_SYMBOL +-#endif +- +-#ifdef __cplusplus +-extern "C" { +-#endif +- +-#define BITCOINCONSENSUS_API_VER 1 +- +-typedef enum bitcoinconsensus_error_t +-{ +- bitcoinconsensus_ERR_OK = 0, +- bitcoinconsensus_ERR_TX_INDEX, +- bitcoinconsensus_ERR_TX_SIZE_MISMATCH, +- bitcoinconsensus_ERR_TX_DESERIALIZE, +- bitcoinconsensus_ERR_AMOUNT_REQUIRED, +- bitcoinconsensus_ERR_INVALID_FLAGS, +-} bitcoinconsensus_error; +- +-/** Script verification flags */ +-enum +-{ +- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NONE = 0, +- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts +- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG = (1U << 2), // enforce strict DER (BIP66) compliance +- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NULLDUMMY = (1U << 4), // enforce NULLDUMMY (BIP147) +- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9), // enable CHECKLOCKTIMEVERIFY (BIP65) +- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY = (1U << 10), // enable CHECKSEQUENCEVERIFY (BIP112) +- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS = (1U << 11), // enable WITNESS (BIP141) +- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL = bitcoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH | bitcoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG | +- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NULLDUMMY | bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY | +- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY | bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS +-}; +- +-/// Returns 1 if the input nIn of the serialized transaction pointed to by +-/// txTo correctly spends the scriptPubKey pointed to by scriptPubKey under +-/// the additional constraints specified by flags. +-/// If not NULL, err will contain an error/success code for the operation +-EXPORT_SYMBOL int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, +- const unsigned char *txTo , unsigned int txToLen, +- unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err); +- +-EXPORT_SYMBOL int bitcoinconsensus_verify_script_with_amount(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount, +- const unsigned char *txTo , unsigned int txToLen, +- unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err); +- +-EXPORT_SYMBOL unsigned int bitcoinconsensus_version(); +- +-#ifdef __cplusplus +-} // extern "C" +-#endif +- +-#undef EXPORT_SYMBOL +- +-#endif // BITCOIN_BITCOINCONSENSUS_H diff --git a/src/script/bitcoinconsensus.cpp b/src/script/monacoinconsensus.cpp -similarity index 76% +similarity index 75% rename from src/script/bitcoinconsensus.cpp rename to src/script/monacoinconsensus.cpp -index b629f4278..1471c3ecd 100644 +index c4ab441..fbfffd7 100644 --- a/src/script/bitcoinconsensus.cpp +++ b/src/script/monacoinconsensus.cpp @@ -3,7 +3,7 @@ @@ -160,7 +389,7 @@ index b629f4278..1471c3ecd 100644 #include "primitives/transaction.h" #include "pubkey.h" -@@ -54,7 +54,7 @@ private: +@@ -55,7 +55,7 @@ private: size_t m_remaining; }; @@ -169,29 +398,39 @@ index b629f4278..1471c3ecd 100644 { if (ret) *ret = serror; -@@ -71,49 +71,49 @@ ECCryptoClosure instance_of_eccryptoclosure; +@@ -73,57 +73,57 @@ ECCryptoClosure instance_of_eccryptoclosure; + /** Check that all specified flags are part of the libconsensus interface. */ + static bool verify_flags(unsigned int flags) + { +- return (flags & ~(bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL)) == 0; ++ return (flags & ~(monacoinconsensus_SCRIPT_FLAGS_VERIFY_ALL)) == 0; + } static int verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, CAmount amount, const unsigned char *txTo , unsigned int txToLen, - unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err) + unsigned int nIn, unsigned int flags, monacoinconsensus_error* err) { + if (!verify_flags(flags)) { +- return bitcoinconsensus_ERR_INVALID_FLAGS; ++ return monacoinconsensus_ERR_INVALID_FLAGS; + } try { TxInputStream stream(SER_NETWORK, PROTOCOL_VERSION, txTo, txToLen); - CTransaction tx; - stream >> tx; + CTransaction tx(deserialize, stream); if (nIn >= tx.vin.size()) - return set_error(err, bitcoinconsensus_ERR_TX_INDEX); + return set_error(err, monacoinconsensus_ERR_TX_INDEX); - if (tx.GetSerializeSize(SER_NETWORK, PROTOCOL_VERSION) != txToLen) + if (GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION) != txToLen) - return set_error(err, bitcoinconsensus_ERR_TX_SIZE_MISMATCH); + return set_error(err, monacoinconsensus_ERR_TX_SIZE_MISMATCH); // Regardless of the verification result, the tx did not error. - set_error(err, bitcoinconsensus_ERR_OK); + set_error(err, monacoinconsensus_ERR_OK); + PrecomputedTransactionData txdata(tx); - return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), nIn < tx.wit.vtxinwit.size() ? &tx.wit.vtxinwit[nIn].scriptWitness : NULL, flags, TransactionSignatureChecker(&tx, nIn, amount, txdata), NULL); + return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), &tx.vin[nIn].scriptWitness, flags, TransactionSignatureChecker(&tx, nIn, amount, txdata), NULL); } catch (const std::exception&) { - return set_error(err, bitcoinconsensus_ERR_TX_DESERIALIZE); // Error deserializing + return set_error(err, monacoinconsensus_ERR_TX_DESERIALIZE); // Error deserializing @@ -232,46 +471,62 @@ index b629f4278..1471c3ecd 100644 - return BITCOINCONSENSUS_API_VER; + return MONACOINCONSENSUS_API_VER; } -diff --git a/src/script/bitcoinconsensus.h b/src/script/monacoinconsensus.h -similarity index 54% -rename from src/script/bitcoinconsensus.h -rename to src/script/monacoinconsensus.h -index 1d2d5c23e..219964f36 100644 ---- a/src/script/bitcoinconsensus.h +diff --git a/src/script/monacoinconsensus.h b/src/script/monacoinconsensus.h +new file mode 100644 +index 0000000..fb87a75 +--- /dev/null +++ b/src/script/monacoinconsensus.h -@@ -33,42 +33,42 @@ - extern "C" { - #endif - --#define BITCOINCONSENSUS_API_VER 1 +@@ -0,0 +1,83 @@ ++// Copyright (c) 2009-2010 Satoshi Nakamoto ++// Copyright (c) 2009-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. ++ ++#ifndef BITCOIN_MONACOINCONSENSUS_H ++#define BITCOIN_MONACOINCONSENSUS_H ++ ++#include <stdint.h> ++ ++#if defined(BUILD_BITCOIN_INTERNAL) && defined(HAVE_CONFIG_H) ++#include "config/bitcoin-config.h" ++ #if defined(_WIN32) ++ #if defined(DLL_EXPORT) ++ #if defined(HAVE_FUNC_ATTRIBUTE_DLLEXPORT) ++ #define EXPORT_SYMBOL __declspec(dllexport) ++ #else ++ #define EXPORT_SYMBOL ++ #endif ++ #endif ++ #elif defined(HAVE_FUNC_ATTRIBUTE_VISIBILITY) ++ #define EXPORT_SYMBOL __attribute__ ((visibility ("default"))) ++ #endif ++#elif defined(MSC_VER) && !defined(STATIC_LIBMONACOINCONSENSUS) ++ #define EXPORT_SYMBOL __declspec(dllimport) ++#endif ++ ++#ifndef EXPORT_SYMBOL ++ #define EXPORT_SYMBOL ++#endif ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ +#define MONACOINCONSENSUS_API_VER 1 - --typedef enum bitcoinconsensus_error_t ++ +typedef enum monacoinconsensus_error_t - { -- bitcoinconsensus_ERR_OK = 0, -- bitcoinconsensus_ERR_TX_INDEX, -- bitcoinconsensus_ERR_TX_SIZE_MISMATCH, -- bitcoinconsensus_ERR_TX_DESERIALIZE, -- bitcoinconsensus_ERR_AMOUNT_REQUIRED, --} bitcoinconsensus_error; ++{ + monacoinconsensus_ERR_OK = 0, + monacoinconsensus_ERR_TX_INDEX, + monacoinconsensus_ERR_TX_SIZE_MISMATCH, + monacoinconsensus_ERR_TX_DESERIALIZE, + monacoinconsensus_ERR_AMOUNT_REQUIRED, ++ monacoinconsensus_ERR_INVALID_FLAGS, +} monacoinconsensus_error; - - /** Script verification flags */ - enum - { -- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NONE = 0, -- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts -- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG = (1U << 2), // enforce strict DER (BIP66) compliance -- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NULLDUMMY = (1U << 4), // enforce NULLDUMMY (BIP147) -- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9), // enable CHECKLOCKTIMEVERIFY (BIP65) -- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY = (1U << 10), // enable CHECKSEQUENCEVERIFY (BIP112) -- bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS = (1U << 11), // enable WITNESS (BIP141) ++ ++/** Script verification flags */ ++enum ++{ + monacoinconsensus_SCRIPT_FLAGS_VERIFY_NONE = 0, + monacoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH = (1U << 0), // evaluate P2SH (BIP16) subscripts + monacoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG = (1U << 2), // enforce strict DER (BIP66) compliance @@ -279,31 +534,34 @@ index 1d2d5c23e..219964f36 100644 + monacoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9), // enable CHECKLOCKTIMEVERIFY (BIP65) + monacoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY = (1U << 10), // enable CHECKSEQUENCEVERIFY (BIP112) + monacoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS = (1U << 11), // enable WITNESS (BIP141) - }; - - /// Returns 1 if the input nIn of the serialized transaction pointed to by - /// txTo correctly spends the scriptPubKey pointed to by scriptPubKey under - /// the additional constraints specified by flags. - /// If not NULL, err will contain an error/success code for the operation --EXPORT_SYMBOL int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, ++ monacoinconsensus_SCRIPT_FLAGS_VERIFY_ALL = monacoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH | monacoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG | ++ monacoinconsensus_SCRIPT_FLAGS_VERIFY_NULLDUMMY | monacoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY | ++ monacoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY | monacoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS ++}; ++ ++/// Returns 1 if the input nIn of the serialized transaction pointed to by ++/// txTo correctly spends the scriptPubKey pointed to by scriptPubKey under ++/// the additional constraints specified by flags. ++/// If not NULL, err will contain an error/success code for the operation +EXPORT_SYMBOL int monacoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, - const unsigned char *txTo , unsigned int txToLen, -- unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err); ++ const unsigned char *txTo , unsigned int txToLen, + unsigned int nIn, unsigned int flags, monacoinconsensus_error* err); - --EXPORT_SYMBOL int bitcoinconsensus_verify_script_with_amount(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount, ++ +EXPORT_SYMBOL int monacoinconsensus_verify_script_with_amount(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount, - const unsigned char *txTo , unsigned int txToLen, -- unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err); ++ const unsigned char *txTo , unsigned int txToLen, + unsigned int nIn, unsigned int flags, monacoinconsensus_error* err); - --EXPORT_SYMBOL unsigned int bitcoinconsensus_version(); ++ +EXPORT_SYMBOL unsigned int monacoinconsensus_version(); - - #ifdef __cplusplus - } // extern "C" ++ ++#ifdef __cplusplus ++} // extern "C" ++#endif ++ ++#undef EXPORT_SYMBOL ++ ++#endif // BITCOIN_MONACOINCONSENSUS_H diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp -index 532921a72..5a2132198 100644 +index 3218416..a6feed0 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -16,7 +16,7 @@ @@ -315,22 +573,25 @@ index 532921a72..5a2132198 100644 #endif #include <fstream> -@@ -173,11 +173,11 @@ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, const CScript +@@ -170,13 +170,13 @@ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, const CScript #if defined(HAVE_CONSENSUS_LIB) CDataStream stream(SER_NETWORK, PROTOCOL_VERSION); stream << tx2; -- if (flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS) { -- BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script_with_amount(begin_ptr(scriptPubKey), scriptPubKey.size(), txCredit.vout[0].nValue, (const unsigned char*)&stream[0], stream.size(), 0, flags, NULL) == expect, message); -+ if (flags & monacoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS) { -+ BOOST_CHECK_MESSAGE(monacoinconsensus_verify_script_with_amount(begin_ptr(scriptPubKey), scriptPubKey.size(), txCredit.vout[0].nValue, (const unsigned char*)&stream[0], stream.size(), 0, flags, NULL) == expect, message); - } else { -- BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script_with_amount(begin_ptr(scriptPubKey), scriptPubKey.size(), 0, (const unsigned char*)&stream[0], stream.size(), 0, flags, NULL) == expect, message); -- BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script(begin_ptr(scriptPubKey), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), 0, flags, NULL) == expect,message); -+ BOOST_CHECK_MESSAGE(monacoinconsensus_verify_script_with_amount(begin_ptr(scriptPubKey), scriptPubKey.size(), 0, (const unsigned char*)&stream[0], stream.size(), 0, flags, NULL) == expect, message); -+ BOOST_CHECK_MESSAGE(monacoinconsensus_verify_script(begin_ptr(scriptPubKey), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), 0, flags, NULL) == expect,message); +- int libconsensus_flags = flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL; ++ int libconsensus_flags = flags & monacoinconsensus_SCRIPT_FLAGS_VERIFY_ALL; + if (libconsensus_flags == flags) { +- if (flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS) { +- BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script_with_amount(scriptPubKey.data(), scriptPubKey.size(), txCredit.vout[0].nValue, (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, NULL) == expect, message); ++ if (flags & monacoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS) { ++ BOOST_CHECK_MESSAGE(monacoinconsensus_verify_script_with_amount(scriptPubKey.data(), scriptPubKey.size(), txCredit.vout[0].nValue, (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, NULL) == expect, message); + } else { +- BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script_with_amount(scriptPubKey.data(), scriptPubKey.size(), 0, (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, NULL) == expect, message); +- BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script(scriptPubKey.data(), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, NULL) == expect,message); ++ BOOST_CHECK_MESSAGE(monacoinconsensus_verify_script_with_amount(scriptPubKey.data(), scriptPubKey.size(), 0, (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, NULL) == expect, message); ++ BOOST_CHECK_MESSAGE(monacoinconsensus_verify_script(scriptPubKey.data(), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, NULL) == expect,message); + } } #endif - } -- -2.13.1 +2.13.3 @@ -2,7 +2,7 @@ pkgname=monacoin-qt _coinname=monacoin -pkgver=0.13.2.2 +pkgver=0.14.2 pkgrel=1 pkgdesc="peer-to-peer network based digital currency - Qt GUI" arch=('i686' 'x86_64') @@ -15,8 +15,8 @@ optdepends=('qrencode: for generating QR codes within the GUI' 'zeromq: send not source=("https://github.com/monacoinproject/${_coinname}/archive/${_coinname}-${pkgver}.tar.gz" "0001-rename-libbitcoinconsensus-to-libmonacoinconsensus.patch" "monacoin-qt.desktop") -sha256sums=('4ae8b22dd3fcf3c805ea5518df89164da6e8631acbc4c7c456516dc46711e877' - 'cc40072b3c614d8e07dabd68af1ae66304e2b4527f5338c6139d3e081c9dc17f' +sha256sums=('03eac8256932150dfa2f399931530545f90ff8d03b4559f03e40836cfbf7be02' + 'bdb0f7efd41b02cb0407b194a2f8cb28d3c82f6ec7bbaf26e1144bf302e7f7d4' '4af25bac0076c6d2060832b66819741d3e049a71d6ad5f1a26a2700415d23cfc') install=monacoin.install |