From 31abac4daf74f82cf9cd7c779ebb2ed8ded1d598 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Tue, 25 Oct 2016 21:19:47 +0100 Subject: 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. --- src/wallet/wallet2.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/wallet/wallet2.h') 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 sources; - std::vector destinations; cryptonote::tx_destination_entry change_dts; + std::vector splitted_dsts; + std::list selected_transfers; std::vector 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; -- cgit v1.2.3