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/wallet/wallet2.h | |
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/wallet/wallet2.h')
-rw-r--r-- | src/wallet/wallet2.h | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 4c361df81..488902d5d 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -99,7 +99,8 @@ namespace tools struct transfer_details { uint64_t m_block_height; - cryptonote::transaction m_tx; + cryptonote::transaction_prefix m_tx; + crypto::hash m_txid; size_t m_internal_output_index; uint64_t m_global_output_index; bool m_spent; @@ -123,7 +124,7 @@ namespace tools struct unconfirmed_transfer_details { - cryptonote::transaction m_tx; + cryptonote::transaction_prefix m_tx; uint64_t m_amount_in; uint64_t m_amount_out; uint64_t m_change; @@ -502,9 +503,9 @@ namespace tools }; } BOOST_CLASS_VERSION(tools::wallet2, 14) -BOOST_CLASS_VERSION(tools::wallet2::transfer_details, 2) +BOOST_CLASS_VERSION(tools::wallet2::transfer_details, 3) BOOST_CLASS_VERSION(tools::wallet2::payment_details, 1) -BOOST_CLASS_VERSION(tools::wallet2::unconfirmed_transfer_details, 4) +BOOST_CLASS_VERSION(tools::wallet2::unconfirmed_transfer_details, 5) BOOST_CLASS_VERSION(tools::wallet2::confirmed_transfer_details, 2) namespace boost @@ -535,7 +536,17 @@ namespace boost a & x.m_block_height; a & x.m_global_output_index; a & x.m_internal_output_index; - a & x.m_tx; + if (ver < 3) + { + cryptonote::transaction tx; + a & tx; + x.m_tx = (const cryptonote::transaction_prefix&)tx; + x.m_txid = cryptonote::get_transaction_hash(tx); + } + else + { + a & x.m_tx; + } a & x.m_spent; a & x.m_key_image; if (ver < 1) @@ -552,6 +563,9 @@ namespace boost return; } a & x.m_spent_height; + if (ver < 3) + return; + a & x.m_txid; } template <class Archive> @@ -559,7 +573,16 @@ namespace boost { a & x.m_change; a & x.m_sent_time; - a & x.m_tx; + if (ver < 5) + { + cryptonote::transaction tx; + a & tx; + x.m_tx = (const cryptonote::transaction_prefix&)tx; + } + else + { + a & x.m_tx; + } if (ver < 1) return; a & x.m_dests; |