| 122 | } |
| 123 | |
| 124 | static bool ExtractPubKey(const CScript &dest, CPubKey& pubKeyOut) |
| 125 | { |
| 126 | //TODO: Use Solver to extract this? |
| 127 | CScript::const_iterator pc = dest.begin(); |
| 128 | opcodetype opcode; |
| 129 | std::vector<unsigned char> vch; |
| 130 | if (!dest.GetOp(pc, opcode, vch) || !CPubKey::ValidSize(vch)) |
| 131 | return false; |
| 132 | pubKeyOut = CPubKey(vch); |
| 133 | if (!pubKeyOut.IsFullyValid()) |
| 134 | return false; |
| 135 | if (!dest.GetOp(pc, opcode, vch) || opcode != OP_CHECKSIG || dest.GetOp(pc, opcode, vch)) |
| 136 | return false; |
| 137 | return true; |
| 138 | } |
| 139 | |
| 140 | bool CBasicKeyStore::AddWatchOnly(const CScript &dest) |
| 141 | { |
no test coverage detected