Confirm positive and negative spends with and without priv keys

This commit is contained in:
miketout
2018-10-07 14:21:43 -07:00
parent ccc47c554c
commit 281a5e2eec
3 changed files with 82 additions and 45 deletions

View File

@@ -206,7 +206,7 @@ bool GetCCParams(Eval* eval, const CTransaction &tx, uint32_t nIn,
uint256 blockHash;
bool isValid = false;
if (myGetTransaction(tx.vin[nIn].prevout.hash, txOut, blockHash) && txOut.vout.size() > nIn)
if (myGetTransaction(tx.vin[nIn].prevout.hash, txOut, blockHash) && txOut.vout.size() > tx.vin[nIn].prevout.n)
{
CBlockIndex index;
if (eval->GetBlock(blockHash, index))
@@ -221,6 +221,15 @@ bool GetCCParams(Eval* eval, const CTransaction &tx, uint32_t nIn,
if (tx.vout.size() > 0 && tx.vout[tx.vout.size() - 1].scriptPubKey.IsOpReturn())
{
tx.vout[tx.vout.size() - 1].scriptPubKey.GetOpretData(params);
if (params.size() == 1)
{
CScript scr = CScript(params[0]);
if (scr.IsOpReturn())
{
params.clear();
scr.GetOpretData(params);
}
}
}
isValid = true;
}