|
|
@ -205,75 +205,6 @@ namespace xmreg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
|
|
|
get_payment_id(const transaction& tx,
|
|
|
|
|
|
|
|
crypto::hash& payment_id)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
payment_id = null_hash;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<tx_extra_field> tx_extra_fields;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!parse_tx_extra(tx.extra, tx_extra_fields))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tx_extra_nonce extra_nonce;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (find_tx_extra_field_by_type(tx_extra_fields, extra_nonce))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!get_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
|
|
|
get_encrypted_payment_id(const transaction& tx,
|
|
|
|
|
|
|
|
crypto::hash8& payment_id8)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
payment_id8 = null_hash8;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<tx_extra_field> tx_extra_fields;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!parse_tx_extra(tx.extra, tx_extra_fields))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tx_extra_nonce extra_nonce;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (find_tx_extra_field_by_type(tx_extra_fields, extra_nonce))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!get_encrypted_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id8))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// if (decrypt_payment_id(payment_id8, addr.m_view_public_key, ptx.tx_key))
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// memcpy(payment_id8.data, payment_id8.data, 8);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
template<>
|
|
|
|