aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-10-25 21:19:47 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-10-25 21:44:31 +0100
commit31abac4daf74f82cf9cd7c779ebb2ed8ded1d598 (patch)
tree089a43e6b480fd5c2db32c016ea8356fe9c01b6e /src/wallet/wallet2.h
parentMerge pull request #1253 (diff)
downloadmonero-31abac4daf74f82cf9cd7c779ebb2ed8ded1d598.tar.xz
wallet: fix pre-rct cold wallet signing not splitting change
Re-creating the transaction on the cold wallet was not splitting the change, causing the transaction to be rejected by the network. This worked on testnet since amounts do not have to be split. Also add selected_transfers, which can now be saved since they're size_t rather than iterators. This allows the view wallet to properly set the sent outputs as spent and update balance. Bump transfer file version numbers to match.
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet2.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index fa9797219..39a2a37f1 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -154,16 +154,18 @@ namespace tools
struct tx_construction_data
{
std::vector<cryptonote::tx_source_entry> sources;
- std::vector<cryptonote::tx_destination_entry> destinations;
cryptonote::tx_destination_entry change_dts;
+ std::vector<cryptonote::tx_destination_entry> splitted_dsts;
+ std::list<size_t> selected_transfers;
std::vector<uint8_t> extra;
uint64_t unlock_time;
bool use_rct;
BEGIN_SERIALIZE_OBJECT()
FIELD(sources)
- FIELD(destinations)
FIELD(change_dts)
+ FIELD(splitted_dsts)
+ FIELD(selected_transfers)
FIELD(extra)
VARINT_FIELD(unlock_time)
FIELD(use_rct)
@@ -930,8 +932,9 @@ namespace tools
ptx.tx_key = tx_key;
ptx.dests = dsts;
ptx.construction_data.sources = sources;
- ptx.construction_data.destinations = dsts;
ptx.construction_data.change_dts = change_dts;
+ ptx.construction_data.splitted_dsts = splitted_dsts;
+ ptx.construction_data.selected_transfers = selected_transfers;
ptx.construction_data.extra = tx.extra;
ptx.construction_data.unlock_time = unlock_time;
ptx.construction_data.use_rct = false;