From 4c1cd287beafb0b22c74fd229247a559722dd0f3 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 4 Jan 2017 12:17:23 -0800 Subject: [PATCH] Fixes a bug where the unsigned transaction was logged by z_sendmany after a successful sign and send, meaning that the logged hash fragment would be different from the txid logged by "AddToWallet". This issue occured when sending from transparent addresses, as utxo inputs must be signed. It did not occur when sending from shielded addresses. --- src/wallet/asyncrpcoperation_sendmany.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wallet/asyncrpcoperation_sendmany.cpp b/src/wallet/asyncrpcoperation_sendmany.cpp index c65664eae..6fa30d07d 100644 --- a/src/wallet/asyncrpcoperation_sendmany.cpp +++ b/src/wallet/asyncrpcoperation_sendmany.cpp @@ -776,6 +776,12 @@ void AsyncRPCOperation_sendmany::sign_send_raw_transaction(Object obj) o.push_back(Pair("hex", signedtxn)); set_result(Value(o)); } + + // Keep the signed transaction so we can hash to the same txid + CDataStream stream(ParseHex(signedtxn), SER_NETWORK, PROTOCOL_VERSION); + CTransaction tx; + stream >> tx; + tx_ = tx; }