From cb4ffa16cbb53475e4cdc0e6d898911456a4ea5c Mon Sep 17 00:00:00 2001 From: random-zebra Date: Tue, 14 May 2019 23:22:41 +0200 Subject: [PATCH] [zPIV] remove enforcement from 'CreateZerocoinSpendTransaction' fixing the unit tests --- src/test/zerocoin_transactions_tests.cpp | 4 ++-- src/wallet/wallet.cpp | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/test/zerocoin_transactions_tests.cpp b/src/test/zerocoin_transactions_tests.cpp index f8b1632e66208..51aa3b605bcc6 100644 --- a/src/test/zerocoin_transactions_tests.cpp +++ b/src/test/zerocoin_transactions_tests.cpp @@ -42,7 +42,7 @@ BOOST_AUTO_TEST_CASE(zerocoin_spend_test) CZerocoinSpendReceipt receipt; cWallet.SpendZerocoin(nAmount, *wtx, receipt, vMints, fMintChange, fMinimizeChange); - BOOST_CHECK_MESSAGE(receipt.GetStatus() == ZPIV_TRX_FUNDS_PROBLEMS, "Failed Invalid Amount Check"); + BOOST_CHECK_MESSAGE(receipt.GetStatus() == ZPIV_TRX_FUNDS_PROBLEMS, strprintf("Failed Invalid Amount Check: %s", receipt.GetStatusMessage())); nAmount = 1; CZerocoinSpendReceipt receipt2; @@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE(zerocoin_spend_test) // if using "wallet.dat", instead of "unlocked.dat" need this /// BOOST_CHECK_MESSAGE(vString == "Error: Wallet locked, unable to create transaction!"," Locked Wallet Check Failed"); - BOOST_CHECK_MESSAGE(receipt2.GetStatus() == ZPIV_TRX_FUNDS_PROBLEMS, "Failed Invalid Amount Check"); + BOOST_CHECK_MESSAGE(receipt2.GetStatus() == ZPIV_TRX_FUNDS_PROBLEMS, strprintf("Failed Invalid Amount Check: %s", receipt.GetStatusMessage())); } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 2ed1034daba73..6b990594dc15d 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4904,12 +4904,6 @@ bool CWallet::MintsToInputVectorPublicSpend(std::map& ma bool CWallet::CreateZerocoinSpendTransaction(CAmount nValue, CWalletTx& wtxNew, CReserveKey& reserveKey, CZerocoinSpendReceipt& receipt, vector& vSelectedMints, vector& vNewMints, bool fMintChange, bool fMinimizeChange, CBitcoinAddress* address) { - // Check enforcement - if (chainActive.Tip()->nHeight < Params().Zerocoin_Block_Public_Spend_Enabled()){ - receipt.SetStatus(_("New protocol enforcement not activated"), ZPIV_SPEND_ERROR); - return false; - } - // Check available funds int nStatus = ZPIV_TRX_FUNDS_PROBLEMS; if (nValue > GetZerocoinBalance(true)) {