diff options
-rw-r--r-- | src/script/standard.cpp | 1 | ||||
-rw-r--r-- | src/test/script_standard_tests.cpp | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 53fcbe37de..d9269d6147 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -114,6 +114,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::v vSolutionsRet.push_back(std::move(witnessprogram)); return true; } + typeRet = TX_NONSTANDARD; return false; } diff --git a/src/test/script_standard_tests.cpp b/src/test/script_standard_tests.cpp index ff0bf6c66d..7ab0978228 100644 --- a/src/test/script_standard_tests.cpp +++ b/src/test/script_standard_tests.cpp @@ -726,6 +726,32 @@ BOOST_AUTO_TEST_CASE(script_standard_IsMine) BOOST_CHECK(!isInvalid); } + // witness unspendable + { + CBasicKeyStore keystore; + keystore.AddKey(keys[0]); + + scriptPubKey.clear(); + scriptPubKey << OP_0 << ToByteVector(ParseHex("aabb")); + + result = IsMine(keystore, scriptPubKey, isInvalid); + BOOST_CHECK_EQUAL(result, ISMINE_NO); + BOOST_CHECK(!isInvalid); + } + + // witness unknown + { + CBasicKeyStore keystore; + keystore.AddKey(keys[0]); + + scriptPubKey.clear(); + scriptPubKey << OP_16 << ToByteVector(ParseHex("aabb")); + + result = IsMine(keystore, scriptPubKey, isInvalid); + BOOST_CHECK_EQUAL(result, ISMINE_NO); + BOOST_CHECK(!isInvalid); + } + // Nonstandard { CBasicKeyStore keystore; |