From 1c022b9fc2773be9dfdca3b58b5daac26e04a382 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Tue, 10 May 2016 10:27:03 -0400 Subject: [PATCH] rpc: add blockindex to getaddressdeltas method for the purposes of secondary sorting by block order --- qa/rpc-tests/addressindex.py | 1 + src/rpcmisc.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/qa/rpc-tests/addressindex.py b/qa/rpc-tests/addressindex.py index a07d4de1e..47102a02c 100755 --- a/qa/rpc-tests/addressindex.py +++ b/qa/rpc-tests/addressindex.py @@ -177,6 +177,7 @@ class AddressIndexTest(BitcoinTestFramework): 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]}) diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 8dc8f7146..328e9eb29 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -672,6 +672,7 @@ UniValue getaddressdeltas(const UniValue& params, bool fHelp) 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);