Monero: RPC get_transaction_pool not json serializable

Created on 23 Jan 2018  路  5Comments  路  Source: monero-project/monero

RPC method get_transaction_pool in master branch (I'm looking at commit 5f09d6c) returns an object with the tx_blob, not present in the latest released version (0.11.1.0).

IMHO this creates two problems:

  • the content of this key is not JSON serializable
  • the serialization takes quite a long time, resulting in very slow response of this API call

I see two possible options:

  • adding an optional parameter to get_transaction_pool for omitting tx_blob
  • create a separate endpoint for this purpose
resolved

Most helpful comment

I support the idea of returning tx_blob in hex representation just like gettransactions call. I used to call this method but since the tx_blob was added i can't parse the response.

@moneromooo-monero get_transaction_pool_hashes have also a mixed format response.
It's not a full binary response. It's a json with a Binary stream in the tx_hashes field so it's not JSON serializable either.

So, there's another way i can get mempool transactions or at least the hashes to call gettransactions later?

All 5 comments

I'd be fine with a flag. There's a get_transaction_pool_hashes call too, wihch is meant to be faster (you then ask for tx data for those txes you haven't seen before). I think the blob should be the hex representation of that tx, not the raw binary anyway, and that'd be JSON friendly.

@moneromooo-monero thanks for your quick response.

Didn't know about the get_transaction_pool_hashes, thanks for pointing out.

And yes, the hex representation of the tx would be JSON serializable, as it happens in other RPC calls.

I support the idea of returning tx_blob in hex representation just like gettransactions call. I used to call this method but since the tx_blob was added i can't parse the response.

@moneromooo-monero get_transaction_pool_hashes have also a mixed format response.
It's not a full binary response. It's a json with a Binary stream in the tx_hashes field so it's not JSON serializable either.

So, there's another way i can get mempool transactions or at least the hashes to call gettransactions later?

https://github.com/monero-project/monero/pull/4033

The new RPC is called without the .bin suffix.

+resolved

Was this page helpful?
0 / 5 - 0 ratings