File tree 1 file changed +12
-9
lines changed
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -612,15 +612,18 @@ bool IsSolvable(const SigningProvider& provider, const CScript& script)
612
612
613
613
bool IsSegWitOutput (const SigningProvider& provider, const CScript& script)
614
614
{
615
- std::vector<valtype> solutions;
616
- auto whichtype = Solver (script, solutions);
617
- if (whichtype == TxoutType::WITNESS_V0_SCRIPTHASH || whichtype == TxoutType::WITNESS_V0_KEYHASH || whichtype == TxoutType::WITNESS_UNKNOWN) return true ;
618
- if (whichtype == TxoutType::SCRIPTHASH) {
619
- auto h160 = uint160 (solutions[0 ]);
620
- CScript subscript;
621
- if (provider.GetCScript (CScriptID{h160}, subscript)) {
622
- whichtype = Solver (subscript, solutions);
623
- if (whichtype == TxoutType::WITNESS_V0_SCRIPTHASH || whichtype == TxoutType::WITNESS_V0_KEYHASH || whichtype == TxoutType::WITNESS_UNKNOWN) return true ;
615
+ int version;
616
+ valtype program;
617
+ if (script.IsWitnessProgram (version, program)) return true ;
618
+ if (script.IsPayToScriptHash ()) {
619
+ std::vector<valtype> solutions;
620
+ auto whichtype = Solver (script, solutions);
621
+ if (whichtype == TxoutType::SCRIPTHASH) {
622
+ auto h160 = uint160 (solutions[0 ]);
623
+ CScript subscript;
624
+ if (provider.GetCScript (CScriptID{h160}, subscript)) {
625
+ if (subscript.IsWitnessProgram (version, program)) return true ;
626
+ }
624
627
}
625
628
}
626
629
return false ;
You can’t perform that action at this time.
0 commit comments