aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rpcwallet.cpp8
-rw-r--r--src/wallet.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp
index 7cdcaec77b..bcbae06682 100644
--- a/src/rpcwallet.cpp
+++ b/src/rpcwallet.cpp
@@ -1448,7 +1448,8 @@ Value gettransaction(const Array& params, bool fHelp)
" \"amount\" : x.xxx (numeric) The amount in btc\n"
" }\n"
" ,...\n"
- " ]\n"
+ " ],\n"
+ " \"hex\" : \"data\" (string) Raw data for transaction\n"
"}\n"
"\nbExamples\n"
@@ -1479,6 +1480,11 @@ Value gettransaction(const Array& params, bool fHelp)
ListTransactions(wtx, "*", 0, false, details);
entry.push_back(Pair("details", details));
+ CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
+ ssTx << wtx;
+ string strHex = HexStr(ssTx.begin(), ssTx.end());
+ entry.push_back(Pair("hex", strHex));
+
return entry;
}
diff --git a/src/wallet.h b/src/wallet.h
index 835137938b..ca40ba8185 100644
--- a/src/wallet.h
+++ b/src/wallet.h
@@ -702,7 +702,7 @@ public:
return false;
if (GetDepthInMainChain() >= 1)
return true;
- if (!IsFromMe()) // using wtx's cached debit
+ if (!bSpendZeroConfChange || !IsFromMe()) // using wtx's cached debit
return false;
// If no confirmations but it's from us, we can still