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:
@@ -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
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user