The node you are looking for is at
get_netsync_write_permitted
.