From 7b35aa206589e5d5f68dead1d09540c7982271d7 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Mon, 22 Jul 2019 04:35:17 +0300 Subject: [PATCH 1/3] payments cc fix --- src/cc/payments.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/cc/payments.cpp b/src/cc/payments.cpp index 17507a80e..e329ff5bf 100644 --- a/src/cc/payments.cpp +++ b/src/cc/payments.cpp @@ -75,6 +75,36 @@ */ +// payments cc fix +#if (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32)) + #undef mpz_set_si + #undef mpz_get_si + #define GMP_LIMB_HIGHBIT ((mp_limb_t) 1 << (GMP_LIMB_BITS - 1)) + #define GMP_NEG_CAST(T,x) (-(int64_t)((T)((x) + 1) - 1)) + + int64_t mpz_get_si (const mpz_t u) + { + mp_size_t us = u->_mp_size; + if (us > 0) + return (int64_t) (u->_mp_d[0] & ~GMP_LIMB_HIGHBIT); + else if (us < 0) + return (int64_t) (- u->_mp_d[0] | GMP_LIMB_HIGHBIT); + else + return 0; + } + + void mpz_set_si (mpz_t r, int64_t x) + { + if (x >= 0) + mpz_set_ui (r, x); + else /* (x < 0) */ + { + r->_mp_size = -1; + r->_mp_d[0] = GMP_NEG_CAST (uint64_t, x); + } + } +#endif + // start of consensus code CScript EncodePaymentsTxidOpRet(int64_t allocation,std::vector scriptPubKey,std::vector destopret) From e67ede9c3d3f0d120d576466d487355285fa8c21 Mon Sep 17 00:00:00 2001 From: Alrighttt <36680730+Alrighttt@users.noreply.github.com> Date: Sat, 27 Jul 2019 20:59:53 +0200 Subject: [PATCH 2/3] Revert "payments cc fix" --- src/cc/payments.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/cc/payments.cpp b/src/cc/payments.cpp index e329ff5bf..17507a80e 100644 --- a/src/cc/payments.cpp +++ b/src/cc/payments.cpp @@ -75,36 +75,6 @@ */ -// payments cc fix -#if (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32)) - #undef mpz_set_si - #undef mpz_get_si - #define GMP_LIMB_HIGHBIT ((mp_limb_t) 1 << (GMP_LIMB_BITS - 1)) - #define GMP_NEG_CAST(T,x) (-(int64_t)((T)((x) + 1) - 1)) - - int64_t mpz_get_si (const mpz_t u) - { - mp_size_t us = u->_mp_size; - if (us > 0) - return (int64_t) (u->_mp_d[0] & ~GMP_LIMB_HIGHBIT); - else if (us < 0) - return (int64_t) (- u->_mp_d[0] | GMP_LIMB_HIGHBIT); - else - return 0; - } - - void mpz_set_si (mpz_t r, int64_t x) - { - if (x >= 0) - mpz_set_ui (r, x); - else /* (x < 0) */ - { - r->_mp_size = -1; - r->_mp_d[0] = GMP_NEG_CAST (uint64_t, x); - } - } -#endif - // start of consensus code CScript EncodePaymentsTxidOpRet(int64_t allocation,std::vector scriptPubKey,std::vector destopret) From 8074aabefd3492257b3400245e8b84f75b25324d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 1 Aug 2019 01:12:20 -1100 Subject: [PATCH 3/3] Revert --- src/cc/cclib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/cclib.cpp b/src/cc/cclib.cpp index 4c182e721..dddd59f59 100644 --- a/src/cc/cclib.cpp +++ b/src/cc/cclib.cpp @@ -542,7 +542,7 @@ int64_t AddCClibtxfee(struct CCcontract_info *cp,CMutableTransaction &mtx,CPubKe char coinaddr[64]; int64_t nValue,txfee = 10000; uint256 txid,hashBlock; CTransaction vintx; int32_t vout; std::vector > unspentOutputs; GetCCaddress(cp,coinaddr,pk); - SetCCunspents(unspentOutputs,coinaddr,false); + SetCCunspents(unspentOutputs,coinaddr,true); for (std::vector >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++) { txid = it->first.txhash;