Getting the content of blocks starting from the offset block, with the number of blocks being equal to limit.
1: i64 offset
2: i64 limit
Type of result: PoolListGetResult
We set a limit on the values of offset and limit parameters equal to 100.
We allocate space to the pool of return result in the amount of limit.
We retrieve the last block’s hash value on the blockchain as the current hash and the number of blocks on the blockchain.
In respect of all blocks starting from the offset block, with the number of blocks being equal to limit, we perform the following actions in reverse order:
We search for a block with the current hash value in the pool cache.
If the current block is located at the end of the pool cache, then we:
Download that block and convert it to the API pool format.
If the block falls within the range of blocks to be returned, then we add it to the result pool.
Add the hash value and pool to the pool cache.
Retrieve the previous block's hash value.
Or else we add the current block being viewed to the result and set a hash value equal to the previous block's hash value.
The following structures are used for marshalling purposes:
PoolListGetResult transaction pool list get result
i8 code //status code
string message //status communication
result success boolean flag
set of pools
/** PoolListGet begin */
api->PoolListGet(plg_res, 0, 10);
std::cout << std::endl << std::endl;
/** PoolListGet end */