<p>Yes, it was by design.  The old behaviour was accidental and was <a href="https://github.com/bitcoin/bitcoin/issues/465" rel="nofollow">causing a crash</a> in some situations.</p>

<p>Here are the full details:</p>

<p>In version 0.3.24, the 'from' parameter was simply passed into std::advance() to skip the required number of transactions.  If the value given was bigger than the number of available transactions, it would wrap around, due to how std::advance() works.  I'm not clear on whether advance() is defined to work like that, or if it's dependent on the particular implementation in the library your version was linked against.</p>

<p>Anyway, in version 0.4, the advance() function call was made conditional:</p>

<pre><code>if (txByTime.size() &gt; nFrom) std::advance(it, nFrom);
</code></pre>

<p>meaning to only skip some transactions if the number of transactions available is greater than the number you're trying to skip.</p>

<p>The change was made by Gavin Andresen on August 12, 2011 in response to a <a href="https://github.com/bitcoin/bitcoin/issues/465" rel="nofollow">bug report</a></p>

CC BY-SA 3.0
2012-02-02T12:00:45.493Z
2012-02-11T08:29:56.523Z
2012-02-11T08:29:56.523Z
Chris Moore
<p>I upgraded to Bitcoin v. 0.4.0, and I think the way "listtransactions" works is different now.</p>

<p>Let's assume I have 10 transactions on my account.</p>

<p><strong>Old behavior:</strong></p>

<p>When I call </p>

<pre><code>listtransactions account='', 1, 10
</code></pre>

<p>I get an empty list, and then when I call</p>

<pre><code>listtransactions account='', 1, 11
</code></pre>

<p>it would wrap around and give me the first transaction</p>

<pre><code>listtransactions account='', 1, 12
</code></pre>

<p>would give me the 2nd one, etc.</p>

<p><strong>New behavior:</strong></p>

<p>When I request a non-existent transaction (i.e. the "from" parameter is more than 10), I always get the first transaction.</p>

<p>Does anybody know if this is by design?</p>

<transactions>
Listtransactions in v. 0.4.0 - different behavior?
bitboy9999
# Listtransactions in v. 0.4.0 - different behavior?

(Asked by: username_0 on 2011-10-28)

I upgraded to Bitcoin v. 0.4.0, and I think the way "listtransactions" works is different now.

Let's assume I have 10 transactions on my account.

**Old behavior:**

When I call

```
listtransactions account='', 1, 10

```

I get an empty list, and then when I call

```
listtransactions account='', 1, 11

```

it would wrap around and give me the first transaction

```
listtransactions account='', 1, 12

```

would give me the 2nd one, etc.

**New behavior:**

When I request a non-existent transaction (i.e. the "from" parameter is more than 10), I always get the first transaction.

Does anybody know if this is by design?

**Tags:** transactions


---

## 1 answers

### Answer by username_1 on 2012-02-02. Score: 1

Yes, it was by design. The old behaviour was accidental and was [causing a crash](https://github.com/bitcoin/bitcoin/issues/465) in some situations.

Here are the full details:

In version 0.3.24, the 'from' parameter was simply passed into std::advance() to skip the required number of transactions. If the value given was bigger than the number of available transactions, it would wrap around, due to how std::advance() works. I'm not clear on whether advance() is defined to work like that, or if it's dependent on the particular implementation in the library your version was linked against.

Anyway, in version 0.4, the advance() function call was made conditional:

```
if (txByTime.size() > nFrom) std::advance(it, nFrom);

```

meaning to only skip some transactions if the number of transactions available is greater than the number you're trying to skip.

The change was made by Gavin Andresen on August 12, 2011 in response to a [bug report](https://github.com/bitcoin/bitcoin/issues/465)


---

