mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 21:52:38 +01:00
Do not expose invalidity from IsMine
This commit is contained in:
@@ -38,7 +38,7 @@ enum class IsMineResult
|
||||
NO = 0, //! Not ours
|
||||
WATCH_ONLY = 1, //! Included in watch-only balance
|
||||
SPENDABLE = 2, //! Included in all balances
|
||||
INVALID = 3, //! Not spendable by anyone
|
||||
INVALID = 3, //! Not spendable by anyone (uncompressed pubkey in segwit, P2SH inside P2SH or witness, witness inside witness)
|
||||
};
|
||||
|
||||
bool PermitsUncompressed(IsMineSigVersion sigversion)
|
||||
@@ -173,12 +173,10 @@ IsMineResult IsMineInner(const CKeyStore& keystore, const CScript& scriptPubKey,
|
||||
|
||||
} // namespace
|
||||
|
||||
isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey, bool& isInvalid)
|
||||
isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey)
|
||||
{
|
||||
isInvalid = false;
|
||||
switch (IsMineInner(keystore, scriptPubKey, IsMineSigVersion::TOP)) {
|
||||
case IsMineResult::INVALID:
|
||||
isInvalid = true;
|
||||
case IsMineResult::NO:
|
||||
return ISMINE_NO;
|
||||
case IsMineResult::WATCH_ONLY:
|
||||
@@ -189,12 +187,6 @@ isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey, bool&
|
||||
assert(false);
|
||||
}
|
||||
|
||||
isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey)
|
||||
{
|
||||
bool isInvalid = false;
|
||||
return IsMine(keystore, scriptPubKey, isInvalid);
|
||||
}
|
||||
|
||||
isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest)
|
||||
{
|
||||
CScript script = GetScriptForDestination(dest);
|
||||
|
||||
Reference in New Issue
Block a user