<p>bitcoind will act on the block you submit immediately. But there is no "right after that". Anything can happen between two requests to bitcoind. The responses you get from bitcoind represent a snapshot in time. In between two requests there could be a block reorganization causing not only your new block to be orphaned, but several blocks back in the chain could disappear, being replaced by blocks from a different fork.</p>

<p>You will usually see your new block at the top of the chain, but don't rely on that or you will have race conditions in your code.</p>

CC BY-SA 3.0
2012-02-25T14:17:51.320Z
2012-02-25T14:17:51.320Z
Dr.Haribo
<p>Bitcoin won't wait for its peers: your block will be considered the latest block in the chain once it has been processed. I'm not sure whether it's safe to say that the second RPC call will always reflect the existence of the new block, though, since Bitcoin is threaded and things might not be done in the exact order you expect.</p>

CC BY-SA 3.0
2012-02-25T06:11:28.503Z
2012-02-25T06:11:28.503Z
theymos
<p>If one sends a solved block to bitcoind server using <code>getmemorypool</code> or <code>getwork</code>, and right after that requests a new block using the same API call, what will the server respond with? Assuming the data is correct, will bitcoind immediately create a new block to be solved with <code>prev block</code> field corresponding to the hash of the recently submitted work, or will it wait for the block to be accepted by its peers first?</p>

CC BY-SA 3.0
2012-02-26T07:17:06.813Z
The simplest answer is this: The client will always work on the longest, valid chain it knows of.
David Schwartz
<bitcoind><protocol><mining-technical-details><getwork><getmemorypool>
How soon does bitcoind incorporate locally solved blocks into its 'getwork' output?
ThePiachu
# How soon does bitcoind incorporate locally solved blocks into its 'getwork' output?

(Asked by: username_0 on 2012-02-25)

If one sends a solved block to bitcoind server using `getmemorypool` or `getwork`, and right after that requests a new block using the same API call, what will the server respond with? Assuming the data is correct, will bitcoind immediately create a new block to be solved with `prev block` field corresponding to the hash of the recently submitted work, or will it wait for the block to be accepted by its peers first?

**Tags:** bitcoind, protocol, mining-technical-details, getwork, getmemorypool

> **Comments:**
> **username_1**: The simplest answer is this: The client will always work on the longest, valid chain it knows of.  

---

## 2 answers

### Answer by username_2 on 2012-02-25. Score: 2 | Accepted answer

bitcoind will act on the block you submit immediately. But there is no "right after that". Anything can happen between two requests to bitcoind. The responses you get from bitcoind represent a snapshot in time. In between two requests there could be a block reorganization causing not only your new block to be orphaned, but several blocks back in the chain could disappear, being replaced by blocks from a different fork.

You will usually see your new block at the top of the chain, but don't rely on that or you will have race conditions in your code.


---

### Answer by username_3 on 2012-02-25. Score: 2

Bitcoin won't wait for its peers: your block will be considered the latest block in the chain once it has been processed. I'm not sure whether it's safe to say that the second RPC call will always reflect the existence of the new block, though, since Bitcoin is threaded and things might not be done in the exact order you expect.


---

