Skip to content

Commit

Permalink
Merge pull request #1237 from ainblockchain/bugfix/platfowner/bugfix
Browse files Browse the repository at this point in the history
Fix ain_getPendingTransactions API
  • Loading branch information
platfowner authored Feb 5, 2024
2 parents b9a996c + 9c55487 commit f4596d6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion json_rpc/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ module.exports = function getTransactionApis(node, p2pServer) {
return {
[JSON_RPC_METHODS.AIN_GET_PENDING_TRANSACTIONS]: function(args, done) {
const beginTime = Date.now();
const result = node.tp.transactions;
const result = {};
for (let [key, value] of node.tp.transactions.entries()) {
if (!result[key]) {
result[key] = [];
}
result[key].push(value)
}
const latency = Date.now() - beginTime;
trafficStatsManager.addEvent(TrafficEventTypes.JSON_RPC_GET, latency);
done(null, JsonRpcUtil.addProtocolVersion({ result }));
Expand Down

0 comments on commit f4596d6

Please sign in to comment.