Duplicate value returned from get_account_history
While working on some changes for the wallet page, I ran into a bug where I'm sometimes getting the same transaction twice in the call to get_account_history.
Here's the sample curl call:
curl -s -d '{"jsonrpc":"2.0", "id":2, "method":"call", "params":["condenser_api", "get_account_history", ["jes2850", 48137926, 5, "49821653785378844", null]] }' https://api.hive.blog
And the response:
{"jsonrpc":"2.0","result":[[1285,{"trx_id":"30314e260f18bf8d6e42c88cbc431de5fd5c3bb6","block":48137926,"trx_in_block":17,"op_in_trx":0,"virtual_op":0,"timestamp":"2020-10-26T15:59:45","op":["claim_reward_balance",{"account":"jes2850","reward_hive":"0.000 HIVE","reward_hbd":"0.000 HBD","reward_vests":"21.141095 VESTS"}]}],[1286,{"trx_id":"30314e260f18bf8d6e42c88cbc431de5fd5c3bb6","block":48137926,"trx_in_block":17,"op_in_trx":0,"virtual_op":0,"timestamp":"2020-10-26T15:59:45","op":["claim_reward_balance",{"account":"jes2850","reward_hive":"0.000 HIVE","reward_hbd":"0.000 HBD","reward_vests":"21.141095 VESTS"}]}],[1287,{"trx_id":"d39e3d49b3d84f1d47f3d2b632b21ff7f70cb07d","block":48139438,"trx_in_block":14,"op_in_trx":0,"virtual_op":0,"timestamp":"2020-10-26T17:15:39","op":["transfer",{"from":"jes2850","to":"blocktrades","amount":"0.100 HIVE","memo":"404"}]}],[1288,{"trx_id":"a2fe2ac0226be1a0143422b4b1bda85ddd1466dd","block":48139457,"trx_in_block":19,"op_in_trx":0,"virtual_op":0,"timestamp":"2020-10-26T17:16:36","op":["transfer",{"from":"blocktrades","to":"jes2850","amount":"0.100 HIVE","memo":"refund by admin"}]}],[1289,{"trx_id":"823ee57fd9b4aa2b073ca627baef2a1939f126f5","block":48139482,"trx_in_block":28,"op_in_trx":0,"virtual_op":0,"timestamp":"2020-10-26T17:17:51","op":["transfer_to_savings",{"from":"jes2850","to":"jes2850","amount":"0.490 HBD","memo":""}]}]],"id":2}
Look at the first two transactions returned: they have separate indexes (1285 and 1286) but it's the same transaction (claim reward balance) and it causes it to show up twice in my transfer history even though there should only be one claim there.
Screenshot of the results to make it easier to see:
Also of note, calling the old version of the get_account_history call (no filters) returns the expected results so it's possibly related to the new filtering code that was recently added.