rpc: add blockindex to getaddressdeltas method

for the purposes of secondary sorting by block order
This commit is contained in:
Braydon Fuller 2016-05-10 10:27:03 -04:00
parent 3c74fff552
commit 1c022b9fc2
2 changed files with 2 additions and 0 deletions

View File

@ -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]})

View File

@ -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);