Skip to content

Commit

Permalink
[zPIV] remove enforcement from 'CreateZerocoinSpendTransaction' fixin…
Browse files Browse the repository at this point in the history
…g the unit tests
  • Loading branch information
random-zebra authored and furszy committed May 23, 2019
1 parent 657bb41 commit cb4ffa1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/test/zerocoin_transactions_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()));

}

Expand Down
6 changes: 0 additions & 6 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4904,12 +4904,6 @@ bool CWallet::MintsToInputVectorPublicSpend(std::map<CBigNum, CZerocoinMint>& ma
bool CWallet::CreateZerocoinSpendTransaction(CAmount nValue, CWalletTx& wtxNew, CReserveKey& reserveKey, CZerocoinSpendReceipt& receipt, vector<CZerocoinMint>& vSelectedMints, vector<CDeterministicMint>& 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)) {
Expand Down

0 comments on commit cb4ffa1

Please sign in to comment.