| 164 | } |
| 165 | |
| 166 | bool DecodePSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error) |
| 167 | { |
| 168 | std::vector<unsigned char> tx_data = DecodeBase64(base64_tx.c_str()); |
| 169 | CDataStream ss_data(tx_data, SER_NETWORK, PROTOCOL_VERSION); |
| 170 | try { |
| 171 | ss_data >> psbt; |
| 172 | if (!ss_data.empty()) { |
| 173 | error = "extra data after PSBT"; |
| 174 | return false; |
| 175 | } |
| 176 | } catch (const std::exception& e) { |
| 177 | error = e.what(); |
| 178 | return false; |
| 179 | } |
| 180 | return true; |
| 181 | } |
| 182 | |
| 183 | uint256 ParseHashStr(const std::string& strHex, const std::string& strName) |
| 184 | { |
no test coverage detected