diff --git a/src/consensus/tx_check.cpp b/src/consensus/tx_check.cpp index 753de12..2334173 100644 --- a/src/consensus/tx_check.cpp +++ b/src/consensus/tx_check.cpp @@ -13,7 +13,7 @@ static bool CheckData(TxValidationState &state, const CTxData *p) { if (p->vData.size() < 1) { - return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-output-data-size-small"); + return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-output-data-size-small..\n"); } const size_t MAX_DATA_OUTPUT_SIZE = 1024; // (max 1024 bytes) 1kb diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 1fcde50..967fecd 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3568,7 +3568,8 @@ bool CWallet::CreateTransactionInternal( CTxData *s = (CTxData*) &datar; out0->nType = s->nType; out0->vData = s->vData; - txNew.vdata.push_back(out0); + if (out0->vData.size() > 0) + txNew.vdata.push_back(out0); break; } case OUTPUT_CONTRACT:{ diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 528188b..e810df1 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1048,7 +1048,7 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati * selected by SelectCoins(); Also create the change output, when needed * @note passing nChangePosInOut as -1 will result in setting a random position */ - bool CreateTransaction(const std::vector& vecSend, CTransactionRef& tx, CAmount& nFeeRet, int& nChangePosInOut, bilingual_str& error, const CCoinControl& coin_control, FeeCalculation& fee_calc_out, bool sign = true, const CTxDataBase& datar = CTxDataBase(), AvailableCoinsType coin_type=ALL_COINS, int extraPayloadSize = 0); + bool CreateTransaction(const std::vector& vecSend, CTransactionRef& tx, CAmount& nFeeRet, int& nChangePosInOut, bilingual_str& error, const CCoinControl& coin_control, FeeCalculation& fee_calc_out, bool sign = true, const CTxDataBase& datar = CTxDataBase(0), AvailableCoinsType coin_type=ALL_COINS, int extraPayloadSize = 0); /** * Submit the transaction to the node's mempool and then relay to peers. * Should be called after CreateTransaction unless you want to abort