changeset 29660:5bb55cc1a115

rpc: include prevhash and prevout information for spending deltas
author Braydon Fuller <courier@braydon.com>
date Thu, 21 Apr 2016 15:07:01 -0400
parents 8cf6c8639b4e
children 970baf3e9150
files src/rpcmisc.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/rpcmisc.cpp	Tue Apr 12 23:25:55 2016 -0400
+++ b/src/rpcmisc.cpp	Thu Apr 21 15:07:01 2016 -0400
@@ -478,6 +478,10 @@
         delta.push_back(Pair("index", (int)it->first.index));
         delta.push_back(Pair("satoshis", it->second.amount));
         delta.push_back(Pair("timestamp", it->second.time));
+        if (it->second.amount < 0) {
+            delta.push_back(Pair("prevtxid", it->second.prevhash.GetHex()));
+            delta.push_back(Pair("prevout", (int)it->second.prevout));
+        }
         result.push_back(delta);
     }