- // If we found another train and it's not headed straight for us, we can keep the blocks we got
- int other_entry = link->get_train()->get_entry_to_block(*link);
- if(other_entry<0)
- throw LogicError("Block reservation inconsistency");
- if(static_cast<unsigned>(entry)!=link->traverse(other_entry))
+ // Ask a lesser priority train to free the block for us
+ if(link->get_train()->get_priority()<priority)
+ if(link->get_train()->free_block(*link))
+ reserved = link->reserve(this);
+
+ if(!reserved)