refresh speedup

Compute derivation only once per tx, instead of once per output. Approx 33% faster while using 75% as much CPU on my machine. Note old functions in cryptonote_core (lookup_acc_outs and is_out_to_acc) are still used by tests.
This commit is contained in:
luigi1111 2016-11-01 11:24:04 -05:00
parent b06c1abaa6
commit a970a4e3cf
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
4 changed files with 22 additions and 17 deletions

View file

@ -876,6 +876,13 @@ namespace cryptonote
return pk == out_key.key;
}
//---------------------------------------------------------------
bool is_out_to_acc_precomp(const crypto::public_key& spend_public_key, const txout_to_key& out_key, const crypto::key_derivation& derivation, size_t output_index)
{
crypto::public_key pk;
derive_public_key(derivation, output_index, spend_public_key, pk);
return pk == out_key.key;
}
//---------------------------------------------------------------
bool lookup_acc_outs(const account_keys& acc, const transaction& tx, std::vector<size_t>& outs, uint64_t& money_transfered)
{
crypto::public_key tx_pub_key = get_tx_pub_key_from_extra(tx);