Stealth addresses

This commit is contained in:
myriadcoin
2014-09-24 21:10:34 +02:00
parent 833e6fe3a3
commit a7f6211208
4 changed files with 34 additions and 5 deletions
+16 -4
View File
@@ -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;
+3
View File
@@ -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
+8 -1
View File
@@ -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);
/*
+7
View File
@@ -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 ");