make tx keys available to the user

They are also stored in the cache file, to be retrieved using
a new get_tx_key command.
This commit is contained in:
moneromooo-monero 2015-08-19 20:59:44 +01:00
parent 776b4fc91a
commit 6c995710d8
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
8 changed files with 77 additions and 10 deletions

View file

@ -408,7 +408,7 @@ namespace cryptonote
return encrypt_payment_id(payment_id, public_key, secret_key);
}
//---------------------------------------------------------------
bool construct_tx(const account_keys& sender_account_keys, const std::vector<tx_source_entry>& sources, const std::vector<tx_destination_entry>& destinations, std::vector<uint8_t> extra, transaction& tx, uint64_t unlock_time)
bool construct_tx(const account_keys& sender_account_keys, const std::vector<tx_source_entry>& sources, const std::vector<tx_destination_entry>& destinations, std::vector<uint8_t> extra, transaction& tx, uint64_t unlock_time, crypto::secret_key &tx_key)
{
tx.vin.clear();
tx.vout.clear();
@ -420,6 +420,7 @@ namespace cryptonote
tx.extra = extra;
keypair txkey = keypair::generate();
add_tx_pub_key_to_extra(tx, txkey.pub);
tx_key = txkey.sec;
// if we have a stealth payment id, find it and encrypt it with the tx key now
std::vector<tx_extra_field> tx_extra_fields;