diff --git a/libraries/plugins/peerplays_sidechain/sidechain_net_handler_bitcoin.cpp b/libraries/plugins/peerplays_sidechain/sidechain_net_handler_bitcoin.cpp index 066eb706..1e72f3d2 100644 --- a/libraries/plugins/peerplays_sidechain/sidechain_net_handler_bitcoin.cpp +++ b/libraries/plugins/peerplays_sidechain/sidechain_net_handler_bitcoin.cpp @@ -1589,6 +1589,22 @@ libbitcoin::chain::script getRedeemScript(const std::vector>= 8; + } + // - If the most significant byte is >= 0x80 and the value is positive, push a + // new zero-byte to make the significant byte < 0x80 again. + if (result.back() & 0x80) + result.push_back(0); + return result; +} + libbitcoin::chain::script get_unlock_script(const std::vector> &son_pubkeys) { using namespace libbitcoin; @@ -1661,7 +1677,7 @@ libbitcoin::chain::script get_unlock_script(const std::vector &tx, const s return res; } -std::vector> read_byte_arrays_from_string(const std::string &string_buf) -{ - std::stringstream ss(string_buf); - boost::property_tree::ptree json; - boost::property_tree::read_json(ss, json); - - std::vector data; - for(auto &v: json) - { - std::string hex = v.second.data(); - bytes item; - item.resize(hex.size() / 2); - fc::from_hex(hex, (char*)&item[0], item.size()); - data.push_back(item); - } - return data; -} - -std::string write_byte_arrays_to_string(const std::vector>& data) -{ - std::string res = "["; - for (unsigned int idx = 0; idx < data.size(); ++idx) { - res += "\"" + fc::to_hex((char*)&data[idx][0], data[idx].size()) + "\""; - if (idx != data.size() - 1) - res += ","; - } - res += "]"; - return res; -} - std::string sidechain_net_handler_bitcoin::create_multisig_address_standalone(const std::vector> &son_pubkeys) { //using namespace libbitcoin;