monero-integrations / monerophp

Monero PHP library + JsonRPC Client
MIT License
116 stars 76 forks source link

get_transfers doesn't work as expected when minimum (and possibly maximum) block height is specified #111

Open mrmena opened 4 years ago

mrmena commented 4 years ago

The wallet RPC documentation allows for filtering of transfers by block height. The monerophp get_transfers method has the optional $min_height and $max_height parameters but they don't work unless the filter_by_height parameter is also set, which it isn't

mrmena commented 4 years ago

After some digging, it looks like if you don't explicitly set the $max_height parameter to something less than the max (4206931337), the filter_by_height parameter doesn't get set.

Relevant source line:

if (($min_height || $max_height) && $max_height != 4206931337) {
    $params['filter_by_height'] = true;
}

Shouldn't I be able to filter by only setting the minimum block height?