VerusStakeTransaction

This commit is contained in:
miketout
2018-10-03 00:58:00 -07:00
parent 8a727a26a7
commit 06f4116090
9 changed files with 140 additions and 58 deletions

View File

@@ -9,6 +9,7 @@
#include "keystore.h"
#include "script/script.h"
#include "script/standard.h"
#include "cc/eval.h"
#include <boost/foreach.hpp>
@@ -83,6 +84,30 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& _scriptPubKey)
break;
}
case TX_CRYPTOCONDITION:
{
// some crypto conditions we consider "mine" if our address is the first specified
// extra address
CScript subScript;
vector<valtype> vParams;
COptCCParams p;
if (scriptPubKey.IsPayToCryptoCondition(&subScript, vParams))
{
if (vParams.size() > 1)
{
p = COptCCParams(vParams[0]);
// if we are the primary output on a coinbase guard, it is ours
if (p.IsValid() && p.evalCode == EVAL_COINBASEGUARD && vParams[1].size() == 20)
{
CKeyID adr = CKeyID(uint160(vParams[1]));
if (keystore.HaveKey(keyID))
return ISMINE_SPENDABLE;
}
}
}
break;
}
case TX_MULTISIG:
{
// Only consider transactions "mine" if we own ALL the