changeset 29670:b45829c31f26

rpc: add blockindex to getaddressdeltas method for the purposes of secondary sorting by block order
author Braydon Fuller <braydon@bitpay.com>
date Tue, 10 May 2016 10:27:03 -0400
parents 9166bd32bbd1
children 5e8151b134ea
files qa/rpc-tests/addressindex.py src/rpcmisc.cpp
diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/qa/rpc-tests/addressindex.py	Wed May 11 18:33:22 2016 -0400
+++ b/qa/rpc-tests/addressindex.py	Tue May 10 10:27:03 2016 -0400
@@ -177,6 +177,7 @@
             balance3 += delta["satoshis"]
         assert_equal(balance3, change_amount)
         assert_equal(deltas[0]["address"], address2)
+        assert_equal(deltas[0]["blockindex"], 1)
 
         # Check that entire range will be queried
         deltasAll = self.nodes[1].getaddressdeltas({"addresses": [address2]})
--- a/src/rpcmisc.cpp	Wed May 11 18:33:22 2016 -0400
+++ b/src/rpcmisc.cpp	Tue May 10 10:27:03 2016 -0400
@@ -672,6 +672,7 @@
         delta.push_back(Pair("satoshis", it->second));
         delta.push_back(Pair("txid", it->first.txhash.GetHex()));
         delta.push_back(Pair("index", (int)it->first.index));
+        delta.push_back(Pair("blockindex", (int)it->first.txindex));
         delta.push_back(Pair("height", it->first.blockHeight));
         delta.push_back(Pair("address", address));
         result.push_back(delta);