diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-06 19:19:25 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-28 21:30:10 +0100 |
commit | a47ceee83b0e04a3c440d9ca5a75cf0ac1d9256e (patch) | |
tree | 4852efeff376ad287d322d34253967497d923a0b /src/cryptonote_core | |
parent | core: add some locking around pool use (diff) | |
download | monero-a47ceee83b0e04a3c440d9ca5a75cf0ac1d9256e.tar.xz |
wallet: do not store signatures in the wallet cache
Saves some substantial space.
Also avoid calculating tx hashes we don't need.
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/cryptonote_basic.h | 2 | ||||
-rw-r--r-- | src/cryptonote_core/cryptonote_boost_serialization.h | 10 | ||||
-rw-r--r-- | src/cryptonote_core/cryptonote_format_utils.cpp | 5 | ||||
-rw-r--r-- | src/cryptonote_core/cryptonote_format_utils.h | 1 |
4 files changed, 17 insertions, 1 deletions
diff --git a/src/cryptonote_core/cryptonote_basic.h b/src/cryptonote_core/cryptonote_basic.h index afe785eb9..e5a5cc6f5 100644 --- a/src/cryptonote_core/cryptonote_basic.h +++ b/src/cryptonote_core/cryptonote_basic.h @@ -180,7 +180,7 @@ namespace cryptonote FIELD(extra) END_SERIALIZE() - protected: + public: transaction_prefix(){} }; diff --git a/src/cryptonote_core/cryptonote_boost_serialization.h b/src/cryptonote_core/cryptonote_boost_serialization.h index f222db94e..41f864803 100644 --- a/src/cryptonote_core/cryptonote_boost_serialization.h +++ b/src/cryptonote_core/cryptonote_boost_serialization.h @@ -144,6 +144,16 @@ namespace boost template <class Archive> + inline void serialize(Archive &a, cryptonote::transaction_prefix &x, const boost::serialization::version_type ver) + { + a & x.version; + a & x.unlock_time; + a & x.vin; + a & x.vout; + a & x.extra; + } + + template <class Archive> inline void serialize(Archive &a, cryptonote::transaction &x, const boost::serialization::version_type ver) { a & x.version; diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp index ee9a00803..ddcab4f05 100644 --- a/src/cryptonote_core/cryptonote_format_utils.cpp +++ b/src/cryptonote_core/cryptonote_format_utils.cpp @@ -321,6 +321,11 @@ namespace cryptonote return pub_key_field.pub_key; } //--------------------------------------------------------------- + crypto::public_key get_tx_pub_key_from_extra(const transaction_prefix& tx_prefix) + { + return get_tx_pub_key_from_extra(tx_prefix.extra); + } + //--------------------------------------------------------------- crypto::public_key get_tx_pub_key_from_extra(const transaction& tx) { return get_tx_pub_key_from_extra(tx.extra); diff --git a/src/cryptonote_core/cryptonote_format_utils.h b/src/cryptonote_core/cryptonote_format_utils.h index 6dac8e888..e0ffbed67 100644 --- a/src/cryptonote_core/cryptonote_format_utils.h +++ b/src/cryptonote_core/cryptonote_format_utils.h @@ -89,6 +89,7 @@ namespace cryptonote bool parse_tx_extra(const std::vector<uint8_t>& tx_extra, std::vector<tx_extra_field>& tx_extra_fields); crypto::public_key get_tx_pub_key_from_extra(const std::vector<uint8_t>& tx_extra); + crypto::public_key get_tx_pub_key_from_extra(const transaction_prefix& tx); crypto::public_key get_tx_pub_key_from_extra(const transaction& tx); bool add_tx_pub_key_to_extra(transaction& tx, const crypto::public_key& tx_pub_key); bool add_extra_nonce_to_tx_extra(std::vector<uint8_t>& tx_extra, const blobdata& extra_nonce); |