| 624 | } |
| 625 | |
| 626 | bool IsSegWitOutput(const SigningProvider& provider, const CScript& script) |
| 627 | { |
| 628 | int version; |
| 629 | valtype program; |
| 630 | if (script.IsWitnessProgram(version, program)) return true; |
| 631 | if (script.IsPayToScriptHash()) { |
| 632 | std::vector<valtype> solutions; |
| 633 | auto whichtype = Solver(script, solutions); |
| 634 | if (whichtype == TxoutType::SCRIPTHASH) { |
| 635 | auto h160 = uint160(solutions[0]); |
| 636 | CScript subscript; |
| 637 | if (provider.GetCScript(CScriptID{h160}, subscript)) { |
| 638 | if (subscript.IsWitnessProgram(version, program)) return true; |
| 639 | } |
| 640 | } |
| 641 | } |
| 642 | return false; |
| 643 | } |
| 644 | |
| 645 | bool SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore, const std::map<COutPoint, Coin>& coins, int nHashType, const uint256& hash_genesis_block, std::map<int, bilingual_str>& input_errors) |
| 646 | { |