Fix public key processing, its Hex not Base58 encoded
This commit is contained in:
parent
06a9b1f75e
commit
2528c349d4
1 changed files with 8 additions and 2 deletions
|
|
@ -761,8 +761,14 @@ bytes add_signatures_to_unsigned_tx(const bytes &unsigned_tx, const std::vector<
|
|||
|
||||
std::string get_weighted_multisig_address(const std::vector<std::pair<std::string, uint64_t>> &public_keys) {
|
||||
std::vector<std::pair<fc::ecc::public_key, uint64_t>> key_data;
|
||||
for (auto p : public_keys)
|
||||
key_data.push_back(std::make_pair(fc::ecc::public_key::from_base58(p.first), p.second));
|
||||
for (auto p : public_keys) {
|
||||
fc::ecc::public_key_data kd;
|
||||
for (uint32_t i = 0; i < p.first.length(); i += 2) {
|
||||
std::string byte_str = p.first.substr(i, 2);
|
||||
kd.data[i / 2] = (char)std::strtol(byte_str.c_str(), NULL, 16);
|
||||
}
|
||||
key_data.push_back(std::make_pair(fc::ecc::public_key(kd), p.second));
|
||||
}
|
||||
bytes redeem_script = generate_redeem_script(key_data);
|
||||
return p2wsh_address_from_redeem_script(redeem_script);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue