mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: allow awaiting payload in progress (#11823)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -17,7 +17,9 @@ use reth_chainspec::{ChainSpec, EthereumHardforks};
|
||||
use reth_payload_builder::{
|
||||
database::CachedReads, KeepPayloadJobAlive, PayloadId, PayloadJob, PayloadJobGenerator,
|
||||
};
|
||||
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes, PayloadBuilderError};
|
||||
use reth_payload_primitives::{
|
||||
BuiltPayload, PayloadBuilderAttributes, PayloadBuilderError, PayloadKind,
|
||||
};
|
||||
use reth_primitives::{
|
||||
constants::{RETH_CLIENT_VERSION, SLOT_DURATION},
|
||||
proofs, BlockNumberOrTag, SealedBlock, Withdrawals,
|
||||
@ -474,7 +476,10 @@ where
|
||||
Ok(self.config.attributes.clone())
|
||||
}
|
||||
|
||||
fn resolve(&mut self) -> (Self::ResolvePayloadFuture, KeepPayloadJobAlive) {
|
||||
fn resolve_kind(
|
||||
&mut self,
|
||||
kind: PayloadKind,
|
||||
) -> (Self::ResolvePayloadFuture, KeepPayloadJobAlive) {
|
||||
let best_payload = self.best_payload.take();
|
||||
|
||||
if best_payload.is_none() && self.pending_block.is_none() {
|
||||
@ -530,7 +535,11 @@ where
|
||||
};
|
||||
}
|
||||
|
||||
let fut = ResolveBestPayload { best_payload, maybe_better, empty_payload };
|
||||
let fut = ResolveBestPayload {
|
||||
best_payload,
|
||||
maybe_better,
|
||||
empty_payload: empty_payload.filter(|_| kind != PayloadKind::WaitForPending),
|
||||
};
|
||||
|
||||
(fut, KeepPayloadJobAlive::No)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user