Пример #1
0
 void unpack( const fc::value& v, fc::signature_t& s ) {
   try {
     auto ve = from_base58(fc::value_cast<fc::string>(v));
     s = fc::raw::unpack<signature_t>(ve);
   } catch ( ... ) {
     wlog( "error unpacking signature" );
   }
 }
Пример #2
0
 void unpack( const fc::value& v, fc::private_key_t& s ) {
   try {
     auto ve = from_base58(fc::value_cast<fc::string>(v));
     s = fc::raw::unpack<private_key_t>(ve);
   } catch ( ... ) {
     wlog( "error unpacking private_key" );
   }
 }
Пример #3
0
bool p2sh_from_base58(bool *test_net,
		      struct ripemd160 *p2sh,
		      const char *base58, size_t len)
{
	u8 version;

	if (!from_base58(&version, p2sh, base58, len))
		return false;

	if (version == 196)
		*test_net = true;
	else if (version == 5)
		*test_net = false;
	else
		return false;
	return true;
}
Пример #4
0
bool bitcoin_from_base58(bool *test_net,
			 struct bitcoin_address *addr,
			 const char *base58, size_t len)
{
	u8 version;

	if (!from_base58(&version, &addr->addr, base58, len))
		return false;

	if (version == 111)
		*test_net = true;
	else if (version == 0)
		*test_net = false;
	else
		return false;
	return true;
}
Пример #5
0
bool ripemd_from_base58(u8 *version,
			struct ripemd160 *ripemd160,
			const char *base58)
{
	return from_base58(version, ripemd160, base58, strlen(base58));
}