mirror of
https://github.com/jwinterm/myriadcoin.git
synced 2026-12-02 12:33:54 +01:00
Stealth addresses
This commit is contained in:
+16
-4
@@ -559,11 +559,23 @@ bool IsStandardTx(const CTransaction& tx, string& reason)
|
||||
}
|
||||
}
|
||||
|
||||
// allow one OP_RETURN per txout
|
||||
if (nDataOut > nTxnOut)
|
||||
if (chainActive.Height() < BLOCK_STEALTH_START)
|
||||
{
|
||||
reason = "multi-op-return";
|
||||
return false;
|
||||
// allow one OP_RETURN per transaction
|
||||
if (nDataOut > 1)
|
||||
{
|
||||
reason = "multi-op-return";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// allow one OP_RETURN per txout
|
||||
if (nDataOut > nTxnOut)
|
||||
{
|
||||
reason = "multi-op-return";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -67,6 +67,9 @@ static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 128;
|
||||
/** Timeout in seconds before considering a block download peer unresponsive. */
|
||||
static const unsigned int BLOCK_DOWNLOAD_TIMEOUT = 60;
|
||||
|
||||
/** Stealth addresses */
|
||||
static const int BLOCK_STEALTH_START = 633800;
|
||||
|
||||
#ifdef USE_UPNP
|
||||
static const int fHaveUPnP = true;
|
||||
#else
|
||||
|
||||
@@ -227,6 +227,13 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
|
||||
|
||||
if (rcp.typeInd == AddressTableModel::AT_Stealth)
|
||||
{
|
||||
if (chainActive.Height() < BLOCK_STEALTH_START)
|
||||
{
|
||||
emit message(tr("Send Coins"), tr("Stealth addresses not yet supported"),
|
||||
CClientUIInterface::MSG_ERROR);
|
||||
return InvalidAddress;
|
||||
}
|
||||
|
||||
CStealthAddress sxAddr;
|
||||
if (sxAddr.SetEncoded(sAddr))
|
||||
{
|
||||
@@ -320,7 +327,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
|
||||
CWalletTx *newTx = transaction.getTransaction();
|
||||
CReserveKey *keyChange = transaction.getPossibleKeyChange();
|
||||
|
||||
int nChangePos = -1;
|
||||
// int nChangePos = -1;
|
||||
bool fCreated = wallet->CreateTransaction(vecSend, *newTx, *keyChange, nFeeRequired, /*nChangePos,*/ strFailReason, coinControl);
|
||||
|
||||
/*
|
||||
|
||||
@@ -1834,6 +1834,13 @@ string CWallet::SendStealthMoney(CScript scriptPubKey, int64_t nValue, std::vect
|
||||
CReserveKey reservekey(this);
|
||||
int64_t nFeeRequired;
|
||||
|
||||
if (chainActive.Height() < BLOCK_STEALTH_START)
|
||||
{
|
||||
string strError = _("Error: Stealth addresses not yet supported");
|
||||
LogPrintf("SendStealthMoney() : %s", strError.c_str());
|
||||
return strError;
|
||||
}
|
||||
|
||||
if (IsLocked())
|
||||
{
|
||||
string strError = _("Error: Wallet locked, unable to create transaction ");
|
||||
|
||||
Reference in New Issue
Block a user