Print warnings when fetching pending blocks (#8711)

* Lots of println to figure out what eth_getBlockByNumber does/should do

* Remove debugging

* Print warnings when fetching pending blocks

When calling `eth_getBlockByNumber` with `pending`, we now print a deprecation warning and:

* if a pending block is found, use it to respond
* if no pending block is found, respond as if if was a request for `Latest`

Addresses issue #8703 (not sure if it's enough to close it tbh)
This commit is contained in:
David
2018-06-01 09:38:20 +02:00
committed by Marek Kotewicz
parent 00b209a29e
commit 799ae29ac4
2 changed files with 30 additions and 18 deletions

View File

@@ -290,10 +290,12 @@ impl Miner {
{
self.sealing.lock().queue
.peek_last_ref()
.and_then(|b| if b.block().header().number() > latest_block_number {
Some(f(b))
} else {
None
.and_then(|b| {
if b.block().header().number() > latest_block_number {
Some(f(b))
} else {
None
}
})
}