case OP_DEPTH:
{
// -- stacksize
- CBigNum bn(stack.size());
+ CBigNum bn((uint16_t) stack.size());
stack.push_back(bn.getvch());
}
break;
// (xn ... x2 x1 x0 n - ... x2 x1 x0 xn)
if (stack.size() < 2)
return false;
- int n = CastToBigNum(stacktop(-1)).getint();
+ int n = CastToBigNum(stacktop(-1)).getint32();
popstack(stack);
if (n < 0 || n >= (int)stack.size())
return false;
// (in -- in size)
if (stack.size() < 1)
return false;
- CBigNum bn(stacktop(-1).size());
+ CBigNum bn((uint16_t) stacktop(-1).size());
stack.push_back(bn.getvch());
}
break;
if ((int)stack.size() < i)
return false;
- int nKeysCount = CastToBigNum(stacktop(-i)).getint();
+ int nKeysCount = CastToBigNum(stacktop(-i)).getint32();
if (nKeysCount < 0 || nKeysCount > 20)
return false;
nOpCount += nKeysCount;
if ((int)stack.size() < i)
return false;
- int nSigsCount = CastToBigNum(stacktop(-i)).getint();
+ int nSigsCount = CastToBigNum(stacktop(-i)).getint32();
if (nSigsCount < 0 || nSigsCount > nKeysCount)
return false;
int isig = ++i;
// (~200 bytes per cache entry times 50,000 entries)
// Since there are a maximum of 20,000 signature operations per block
// 50,000 is a reasonable default.
- int64 nMaxCacheSize = GetArg("-maxsigcachesize", 50000);
+ int64_t nMaxCacheSize = GetArg("-maxsigcachesize", 50000);
if (nMaxCacheSize <= 0) return;
boost::shared_lock<boost::shared_mutex> lock(cs_sigcache);
- while (static_cast<int64>(setValid.size()) > nMaxCacheSize)
+ while (static_cast<int64_t>(setValid.size()) > nMaxCacheSize)
{
// Evict a random entry. Random because that helps
// foil would-be DoS attackers who might try to pre-generate
bool operator()(const CScriptID &scriptID) const { return keystore->HaveCScript(scriptID); }
};
-isminetype IsMine(const CKeyStore &keystore, const CTxDestination &dest)
+isminetype IsMine(const CKeyStore &keystore, const CTxDestination& dest)
{
- if (boost::apply_visitor(CKeyStoreIsMineVisitor(&keystore), dest))
- return MINE_SPENDABLE;
- if (keystore.HaveWatchOnly(dest))
- return MINE_WATCH_ONLY;
- return MINE_NO;
+ CScript script;
+ script.SetDestination(dest);
+ return IsMine(keystore, script);
}
isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey)
vector<valtype> vSolutions;
txnouttype whichType;
if (!Solver(scriptPubKey, whichType, vSolutions)) {
- if (keystore.HaveWatchOnly(scriptPubKey.GetID()))
+ if (keystore.HaveWatchOnly(scriptPubKey))
return MINE_WATCH_ONLY;
return MINE_NO;
}
keyID = CPubKey(vSolutions[0]).GetID();
if (keystore.HaveKey(keyID))
return MINE_SPENDABLE;
- if (keystore.HaveWatchOnly(keyID))
- return MINE_WATCH_ONLY;
break;
case TX_PUBKEYHASH:
keyID = CKeyID(uint160(vSolutions[0]));
if (keystore.HaveKey(keyID))
return MINE_SPENDABLE;
- if (keystore.HaveWatchOnly(keyID))
- return MINE_WATCH_ONLY;
break;
case TX_SCRIPTHASH:
{
CScript subscript;
if (keystore.GetCScript(scriptID, subscript)) {
isminetype ret = IsMine(keystore, subscript);
- if (ret)
+ if (ret == MINE_SPENDABLE)
return ret;
}
- if (keystore.HaveWatchOnly(scriptID))
- return MINE_WATCH_ONLY;
break;
}
case TX_MULTISIG:
}
}
- if (keystore.HaveWatchOnly(scriptPubKey.GetID()))
+ if (keystore.HaveWatchOnly(scriptPubKey))
return MINE_WATCH_ONLY;
return MINE_NO;
}