mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Default to full payload status if the payload has been received
This commit is contained in:
@@ -1431,11 +1431,24 @@ impl ProtoArray {
|
|||||||
.nodes
|
.nodes
|
||||||
.get(node.proto_node_index)
|
.get(node.proto_node_index)
|
||||||
.ok_or(Error::InvalidNodeIndex(node.proto_node_index))?;
|
.ok_or(Error::InvalidNodeIndex(node.proto_node_index))?;
|
||||||
let mut children = vec![(node.with_status(PayloadStatus::Empty), proto_node.clone())];
|
|
||||||
// The FULL virtual child only exists if the payload has been received.
|
// TODO(gloas) this is the actual change we want to keep once PTC is implemented
|
||||||
if proto_node.payload_received().is_ok_and(|received| received) {
|
// let mut children = vec![(node.with_status(PayloadStatus::Empty), proto_node.clone())];
|
||||||
children.push((node.with_status(PayloadStatus::Full), proto_node.clone()));
|
// // The FULL virtual child only exists if the payload has been received.
|
||||||
}
|
// if proto_node.payload_received().is_ok_and(|received| received) {
|
||||||
|
// children.push((node.with_status(PayloadStatus::Full), proto_node.clone()));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// TODO(gloas) remove this and uncomment the code above once we implement PTC
|
||||||
|
// Skip Empty/Full split: go straight to Full when payload received,
|
||||||
|
// giving full payload weight 100% without PTC votes.
|
||||||
|
let children = if proto_node.payload_received().is_ok_and(|received| received) {
|
||||||
|
vec![(node.with_status(PayloadStatus::Full), proto_node.clone())]
|
||||||
|
} else {
|
||||||
|
vec![(node.with_status(PayloadStatus::Empty), proto_node.clone())]
|
||||||
|
};
|
||||||
|
// TODO(gloas) delete up to here
|
||||||
|
|
||||||
Ok(children)
|
Ok(children)
|
||||||
} else {
|
} else {
|
||||||
let child_indices = children_index
|
let child_indices = children_index
|
||||||
|
|||||||
Reference in New Issue
Block a user